mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[ASCollectionNode] add -indexPathsForVisibleNodes (#2451)
This commit is contained in:
committed by
Adlai Holler
parent
9719357901
commit
15aa784fe8
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user