mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Finish Porting indexPath-Oriented Methods to ASTableNode/ASCollectionNode (#2527)
* Finish porting over the indexPath-oriented properties from table/collection view to node * Make indexPathForSelectedRow a property
This commit is contained in:
@@ -582,6 +582,23 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray<NSIndexPath *> *)convertIndexPathsToCollectionNode:(NSArray<NSIndexPath *> *)indexPaths
|
||||
{
|
||||
if (indexPaths == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSMutableArray<NSIndexPath *> *indexPathsArray = [NSMutableArray arrayWithCapacity:indexPaths.count];
|
||||
|
||||
for (NSIndexPath *indexPathInView in indexPaths) {
|
||||
NSIndexPath *indexPath = [self convertIndexPathToCollectionNode:indexPathInView];
|
||||
if (indexPath != nil) {
|
||||
[indexPathsArray addObject:indexPath];
|
||||
}
|
||||
}
|
||||
return indexPathsArray;
|
||||
}
|
||||
|
||||
- (ASCellNode *)supplementaryNodeForElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return [_dataController supplementaryNodeOfKind:elementKind atIndexPath:indexPath];
|
||||
|
||||
Reference in New Issue
Block a user