Deprecate indexPath-based Methods on ASTableView/ASCollectionView (#2498)

* Deprecated indexPath methods in ASTableView and ASTableNode and added several indexPath methods to ASTableNode and ASCollectionNode.

* Fixed incorrect doc.
Removed unnecessary __kindof.
This commit is contained in:
george-gw
2016-10-29 18:50:11 +02:00
committed by Adlai Holler
parent c4451edab1
commit d83f058f82
10 changed files with 257 additions and 62 deletions

View File

@@ -608,28 +608,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
return visibleNodes;
}
/**
* TODO: This method was built when the distinction between data source
* index paths and view index paths was unclear. For compatibility, it
* still expects data source index paths for the time being.
*/
- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition
{
ASDisplayNodeAssertMainThread();
// If they passed nil, just forward it and be done.
if (indexPath == nil) {
[super selectItemAtIndexPath:indexPath animated:animated scrollPosition:scrollPosition];
return;
}
NSIndexPath *viewIndexPath = [self convertIndexPathFromCollectionNode:indexPath waitingIfNeeded:YES];
if (viewIndexPath != nil) {
[super selectItemAtIndexPath:viewIndexPath animated:animated scrollPosition:scrollPosition];
} else {
NSLog(@"Warning: Ignoring request to select item at index path %@ because the item did not reach the collection view.", indexPath);
}
}
#pragma mark Internal
/**