UITableView
provides the methods indexPathsForVisibleRows
and visibleCells
, but how can I get the visible sections?
UITableView
provides the methods indexPathsForVisibleRows
and visibleCells
, but how can I get the visible sections?
Or the really easy way would be to take advantage of valueForKeyPath and the NSSet class:
NSSet *visibleSections = [NSSet setWithArray:[[self.tableView indexPathsForVisibleRows] valueForKey:@"section"]];
Basically you get an array of the section values in the visible rows and then populate a set with this to remove duplicates.