mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 06:36:58 +02:00
Call pagination api from appropriate points
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
}
|
||||
|
||||
@property(nonatomic) SpaceMembersCoordinatorBridgePresenter *spaceMembersCoordinatorBridgePresenter;
|
||||
@property (nonatomic, strong) MXThrottler *tableViewPaginationThrottler;
|
||||
|
||||
@end
|
||||
|
||||
@@ -52,6 +53,7 @@
|
||||
directRoomsSectionNumber = 0;
|
||||
|
||||
self.screenTimer = [[AnalyticsScreenTimer alloc] initWithScreen:AnalyticsScreenPeople];
|
||||
self.tableViewPaginationThrottler = [[MXThrottler alloc] initWithMinimumDelay:0.1];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
@@ -106,6 +108,24 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if ([super respondsToSelector:@selector(tableView:willDisplayCell:forRowAtIndexPath:)])
|
||||
{
|
||||
[super tableView:tableView willDisplayCell:cell forRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
[self.tableViewPaginationThrottler throttle:^{
|
||||
NSInteger section = indexPath.section;
|
||||
NSInteger numberOfRowsInSection = [tableView numberOfRowsInSection:section];
|
||||
if (tableView.numberOfSections > section
|
||||
&& indexPath.row == numberOfRowsInSection - 1)
|
||||
{
|
||||
[self->recentsDataSource paginateInSection:section];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Override RecentsViewController
|
||||
|
||||
- (void)refreshCurrentSelectedCell:(BOOL)forceVisible
|
||||
|
||||
Reference in New Issue
Block a user