Added node access methods to ASTableView, ASCollectionView.

This commit is contained in:
Dustin Shahidehpour
2015-01-26 13:57:04 -08:00
parent e1f8342c3b
commit 94cd785870
6 changed files with 78 additions and 2 deletions

View File

@@ -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.