开发者

how to know which cells (row & section) of a UITableView are currently being displayed?

开发者 https://www.devze.com 2023-03-22 00:42 出处:网络
Is there a way to know which rows/sections are being displayed inside a UITableView ? I kno开发者_开发百科w I can use the function :

Is there a way to know which rows/sections are being displayed inside a UITableView ? I kno开发者_开发百科w I can use the function :

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

But, this doesnt help me. For any given moment, I want to know which row/sections are being displayed and do some processing based on that.

Can anyone kindly help me ? Thanks.


At any given moment, you can retrieve the visible cells from the table view, or index paths :

-(NSArray *)visibleCells;
-(NSArray *)indexPathsForVisibleRows;

Check UITableView Class Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消