mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[ASCellNode] Added indexPath property. (#2468)
* [ASCellNode] Added indexPath property. * [ASCellNode] Cached the type of scrollView we're using in the node, and placed that logic in setScrollView. * [ASCellNode] Removed table and collection view from indexPath, since they return the index paths from the view-space. * Changed the logic for getting indexPath so that it works even when the cell is not displayed. * [VerticalWithinHorizontalScrolling] Explicitally synthesized indexPath property.
This commit is contained in:
@@ -476,8 +476,7 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
|
||||
ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection;
|
||||
__weak id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
|
||||
|
||||
std::vector<NSInteger> counts = [self itemCountsFromDataSource];
|
||||
NSMutableArray<ASIndexedNodeContext *> *contexts = [NSMutableArray array];
|
||||
@@ -493,7 +492,7 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
indexPath:indexPath
|
||||
supplementaryElementKind:nil
|
||||
constrainedSize:constrainedSize
|
||||
environmentTraitCollection:environmentTraitCollection]];
|
||||
environment:environment]];
|
||||
}
|
||||
}
|
||||
}];
|
||||
@@ -743,8 +742,7 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
NSArray *sortedIndexPaths = [indexPaths sortedArrayUsingSelector:@selector(compare:)];
|
||||
NSMutableArray<ASIndexedNodeContext *> *contexts = [[NSMutableArray alloc] initWithCapacity:indexPaths.count];
|
||||
|
||||
id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
|
||||
ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection;
|
||||
__weak id<ASEnvironment> environment = [self.environmentDelegate dataControllerEnvironment];
|
||||
|
||||
for (NSIndexPath *indexPath in sortedIndexPaths) {
|
||||
ASCellNodeBlock nodeBlock = [_dataSource dataController:self nodeBlockAtIndexPath:indexPath];
|
||||
@@ -753,7 +751,7 @@ NSString * const ASDataControllerRowNodeKind = @"_ASDataControllerRowNodeKind";
|
||||
indexPath:indexPath
|
||||
supplementaryElementKind:nil
|
||||
constrainedSize:constrainedSize
|
||||
environmentTraitCollection:environmentTraitCollection]];
|
||||
environment:environment]];
|
||||
}
|
||||
|
||||
ASInsertElementsIntoMultidimensionalArrayAtIndexPaths(_nodeContexts[ASDataControllerRowNodeKind], sortedIndexPaths, contexts);
|
||||
|
||||
Reference in New Issue
Block a user