mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Disable UICollectionView prefetching to improve scroll performance (#2861)
This commit is contained in:
parent
89d4193757
commit
d65fe8b5fa
@ -281,6 +281,14 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
if (!(self = [super initWithFrame:frame collectionViewLayout:layout]))
|
if (!(self = [super initWithFrame:frame collectionViewLayout:layout]))
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
|
// Disable UICollectionView prefetching.
|
||||||
|
// Experiments done by Instagram show that this option being YES (default)
|
||||||
|
// when unused causes a significant hit to scroll performance.
|
||||||
|
// https://github.com/Instagram/IGListKit/issues/318
|
||||||
|
if (AS_AT_LEAST_IOS10) {
|
||||||
|
self.prefetchingEnabled = NO;
|
||||||
|
}
|
||||||
|
|
||||||
_layoutController = [[ASCollectionViewLayoutController alloc] initWithCollectionView:self];
|
_layoutController = [[ASCollectionViewLayoutController alloc] initWithCollectionView:self];
|
||||||
|
|
||||||
_rangeController = [[ASRangeController alloc] init];
|
_rangeController = [[ASRangeController alloc] init];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user