Getting visible cell from UITableView pagingEnabled

前端 未结 5 1896
孤城傲影
孤城傲影 2020-12-13 15:35

I have a UITableView with pagingEnabled. Each cell takes up the viewing area of the table. Meaning, each cell is the same height and width as the table. I\'m using custom

5条回答
  •  失恋的感觉
    2020-12-13 16:13

    Simple and elegant way to retrieve visible cells of UITableView, no need to get visible cells by using indexpath values

    NSArray * visibleCells = tableView.visibleCells;
    NSLog(@"Total visible Cells: %i", [visibleCells count]);
    

    If indexpath's of visible cells are needed

    NSArray * paths = [tableView indexPathsForVisibleRows];
    

提交回复
热议问题