UITableView has an instance method called indexPathsForVisibleRows that returns an NSArray objects for each row in the table that are currently visible. You can check this method at any frequency you need and check the correct line. For example, if tableView is a link to your table, the following method will tell you if row 0 is displayed on the screen:
-(BOOL)isRowZeroVisible { NSArray *indexes = [tableView indexPathsForVisibleRows]; for (NSIndexPath *index in indexes) { if (index.row == 0) { return YES; } } return NO; }
Since the UITableView method returns NSIndexPath , you can just as easily expand it to look for sections or row / section combinations.
This is more useful for you than the visibleCells method, which returns an array of table cell objects. Table cell objects are returned, so in large tables, they will ultimately not have a simple correlation with your data source.
Devunwired Jul 24 2018-10-24T00: 00Z
source share