[ASCollectionNode] add -indexPathsForVisibleNodes (#2451)

This commit is contained in:
Hannah Troisi
2016-10-21 10:19:27 -07:00
committed by Adlai Holler
parent 9719357901
commit 15aa784fe8
2 changed files with 19 additions and 0 deletions

View File

@@ -295,6 +295,19 @@
return [self.dataController indexPathForNode:cellNode];
}
- (NSArray<__kindof NSIndexPath *> *)indexPathsForVisibleItems
{
NSMutableArray *indexPathsArray = [NSMutableArray new];
for (ASCellNode *cell in [self visibleNodes]) {
NSIndexPath *indexPath = [self indexPathForNode:cell];
if (indexPath) {
[indexPathsArray addObject:indexPath];
}
}
return indexPathsArray;
}
- (ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [self.dataController nodeAtIndexPath:indexPath];