Question

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.

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top