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
).
Check if a UITableViewCell is completely visible
-
01-06-2022 - |
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.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow