mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[WIP] Trigger new batch fetch for collection view after layout transitions (#1697)
[Table / Collection] Trigger new batch fetch after programmatic scrolls, or layout transitions.
This commit is contained in:
@@ -1002,6 +1002,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
- (NSArray *)visibleNodeIndexPathsForRangeController:(ASRangeController *)rangeController
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
// Calling visibleNodeIndexPathsForRangeController: will trigger UIKit to call reloadData if it never has, which can result
|
||||
// in incorrect layout if performed at zero size. We can use the fact that nothing can be visible at zero size to return fast.
|
||||
BOOL isZeroSized = CGRectEqualToRect(self.bounds, CGRectZero);
|
||||
@@ -1065,6 +1066,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
_performingBatchUpdates = NO;
|
||||
}
|
||||
|
||||
- (void)didCompleteUpdatesInRangeController:(ASRangeController *)rangeController
|
||||
{
|
||||
[self _checkForBatchFetching];
|
||||
}
|
||||
|
||||
- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
Reference in New Issue
Block a user