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

Était-ce utile?

La 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
     }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top