문제

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