Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit d65fe8b

Browse files
author
Adlai Holler
authored
Disable UICollectionView prefetching to improve scroll performance (#2861)
1 parent 89d4193 commit d65fe8b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

AsyncDisplayKit/ASCollectionView.mm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,15 @@ - (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionV
280280
{
281281
if (!(self = [super initWithFrame:frame collectionViewLayout:layout]))
282282
return nil;
283-
283+
284+
// Disable UICollectionView prefetching.
285+
// Experiments done by Instagram show that this option being YES (default)
286+
// when unused causes a significant hit to scroll performance.
287+
// https://github.com/Instagram/IGListKit/issues/318
288+
if (AS_AT_LEAST_IOS10) {
289+
self.prefetchingEnabled = NO;
290+
}
291+
284292
_layoutController = [[ASCollectionViewLayoutController alloc] initWithCollectionView:self];
285293

286294
_rangeController = [[ASRangeController alloc] init];

0 commit comments

Comments
 (0)