mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
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:
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user