mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 11:30:50 +02:00
Call pagination api from appropriate points
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
RecentsDataSource *recentsDataSource;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) MXThrottler *tableViewPaginationThrottler;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomsViewController
|
||||
@@ -41,6 +43,7 @@
|
||||
[super finalizeInit];
|
||||
|
||||
self.screenTimer = [[AnalyticsScreenTimer alloc] initWithScreen:AnalyticsScreenRooms];
|
||||
self.tableViewPaginationThrottler = [[MXThrottler alloc] initWithMinimumDelay:0.1];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
@@ -112,6 +115,24 @@
|
||||
return [super tableView:tableView heightForHeaderInSection:section];
|
||||
}
|
||||
|
||||
- (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 -
|
||||
|
||||
- (void)scrollToNextRoomWithMissedNotifications
|
||||
|
||||
Reference in New Issue
Block a user