Как я могу обнаружить когда a UITableView
был прокручен до нижней части так, чтобы последняя ячейка была видима?
Реализуйте метод tableView: willDisplayCell: forRowAtIndexPath:
в своем UITableViewDelegate и проверьте, последняя ли это строка.
Внутри tableView: cellForRowAtIndexPath:
или tableView: willDisplayCell: forRowAtIndexPath:
вот так:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
NSInteger sectionsAmount = [tableView numberOfSections];
NSInteger rowsAmount = [tableView numberOfRowsInSection:[indexPath section]];
if ([indexPath section] == sectionsAmount - 1 && [indexPath row] == rowsAmount - 1) {
// This is the last cell in the table
}
...
}