Question

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

Was it helpful?

Solution

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
     }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top