mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASTableView/ASCollectionView] Flush pending updates before selecting/scrolling to item (#2034)
This commit is contained in:
@@ -506,6 +506,22 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
return visibleNodes;
|
||||
}
|
||||
|
||||
- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[self waitUntilAllUpdatesAreCommitted];
|
||||
[super scrollToItemAtIndexPath:indexPath atScrollPosition:scrollPosition animated:animated];
|
||||
}
|
||||
|
||||
- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[self waitUntilAllUpdatesAreCommitted];
|
||||
[super selectItemAtIndexPath:indexPath animated:animated scrollPosition:scrollPosition];
|
||||
}
|
||||
|
||||
#pragma mark Internal
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user