Вопрос

How can I make than some method fires then I scroll to half of dataSource array in tableView?

I want to make infinite scroll like this

Это было полезно?

Решение

Use UITableviewDelegate method willDisplayCell: forRowAtIndexPath: and check indexPath.row with dataSource array then fire the method.

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

     if ([dataSourceArray count]/2 == indexPath.row) {
         //invoke the method here
     }
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top