2

How can I check if a UITableViewCell is completely visible on the screen (not cut off by the tab or nav bar)?

I can get the visible cells with this code:

NSArray *indexes = [_tableView indexPathsForVisibleRows];

but I want to exclude cells that are not entirely visible in the screen.

Meet Doshi
  • 4,241
  • 10
  • 40
  • 81

1 Answers1

6

As you have, get the visible cells. The only ones that might be partial are the top and bottom ones. For each, check if its rect (rectForRowAtIndexPath:) is fully within the bounds of the table view (based on contentSize and contentOffset, using CGRectContainsRect).

Wain
  • 118,658
  • 15
  • 128
  • 151