I need to keep track of the visible cells in a UITableView
, since certain events need to occur when cells that represent specific pieces of data become visible. UITableView
doesn't seem to be KVO compliant for -indexPathsForVisibleRows
or -visibleCells
, and there's no UITableViewDelegate
method that gives a hook for being notified that the visible cells have changed.
Is there any way of doing this, short of manually keeping track of my own array, and adding/removing objects every time I insert/remove a row, reload the table, or methods like -tableView:cellForRowAtIndexPath:
are called?
How about UITableViewDelegate method:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
Without hacking/subclassing UITableView or UITableViewCell, the answer appears to be no.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With