mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Added node access methods to ASTableView, ASCollectionView.
This commit is contained in:
11
AsyncDisplayKit.xcworkspace/contents.xcworkspacedata
generated
11
AsyncDisplayKit.xcworkspace/contents.xcworkspacedata
generated
@@ -1 +1,10 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:AsyncDisplayKit.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:AsyncDisplayKit.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -63,6 +63,22 @@
|
||||
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
|
||||
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
|
||||
|
||||
/**
|
||||
* Similar to -cellForItemAtIndexPath:.
|
||||
*
|
||||
* @param indexPath The index path of the requested node.
|
||||
*
|
||||
* @returns a node for display at this indexpath.
|
||||
*/
|
||||
- (ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Similar to -visibleCells.
|
||||
*
|
||||
* @returns an array containing the nodes being displayed on screen.
|
||||
*/
|
||||
- (NSArray *)visibleNodes;
|
||||
|
||||
/**
|
||||
* Query the sized node at `indexPath` for its calculatedSize.
|
||||
*
|
||||
|
||||
@@ -196,6 +196,19 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
return [[_dataController nodeAtIndexPath:indexPath] calculatedSize];
|
||||
}
|
||||
|
||||
- (NSArray *)visibleNodes
|
||||
{
|
||||
NSArray *indexPaths = [self indexPathsForVisibleItems];
|
||||
NSMutableArray *visibleNodes = [[NSMutableArray alloc] init];
|
||||
|
||||
[indexPaths enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
ASCellNode *visibleNode = [self nodeForItemAtIndexPath:obj];
|
||||
[visibleNodes addObject:visibleNode];
|
||||
}];
|
||||
|
||||
return visibleNodes;
|
||||
}
|
||||
|
||||
#pragma mark Assertions.
|
||||
|
||||
- (void)insertSections:(NSIndexSet *)sections
|
||||
@@ -238,6 +251,10 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
[_dataController moveRowAtIndexPath:indexPath toIndexPath:newIndexPath withAnimationOption:kASCollectionViewAnimationNone];
|
||||
}
|
||||
|
||||
- (ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return [_dataController nodeAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Intercepted selectors.
|
||||
|
||||
@@ -72,6 +72,22 @@
|
||||
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
||||
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
|
||||
|
||||
/**
|
||||
* Similar to -cellForRowAtIndexPath:.
|
||||
*
|
||||
* @param indexPath The index path of the requested node.
|
||||
*
|
||||
* @returns a node for display at this indexpath.
|
||||
*/
|
||||
- (ASCellNode *)nodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Similar to -visibleCells.
|
||||
*
|
||||
* @returns an array containing the nodes being displayed on screen.
|
||||
*/
|
||||
- (NSArray *)visibleNodes;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -198,6 +198,24 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
_layoutController.tuningParameters = tuningParameters;
|
||||
}
|
||||
|
||||
- (ASCellNode *)nodeForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return [_dataController nodeAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
- (NSArray *)visibleNodes
|
||||
{
|
||||
NSArray *indexPaths = [self indexPathsForVisibleRows];
|
||||
NSMutableArray *visibleNodes = [[NSMutableArray alloc] init];
|
||||
|
||||
[indexPaths enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
ASCellNode *visibleNode = [self nodeForRowAtIndexPath:obj];
|
||||
[visibleNodes addObject:visibleNode];
|
||||
}];
|
||||
|
||||
return visibleNodes;
|
||||
}
|
||||
|
||||
#pragma mark Assertions.
|
||||
|
||||
- (void)throwUnimplementedException
|
||||
|
||||
@@ -7,4 +7,4 @@ DEPENDENCIES:
|
||||
SPEC CHECKSUMS:
|
||||
OCMock: 6db79185520e24f9f299548f2b8b07e41d881bd5
|
||||
|
||||
COCOAPODS: 0.34.4
|
||||
COCOAPODS: 0.35.0
|
||||
|
||||
Reference in New Issue
Block a user