This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,15 @@ - (void)_updateVisibleNodeIndexPaths
109109 if (ASInterfaceStateIncludesVisible (selfInterfaceState)) {
110110 // If we are already visible, get busy! Better get started on preloading before the user scrolls more...
111111 fetchDataIndexPaths = [_layoutController indexPathsForScrolling: _scrollDirection rangeType: ASLayoutRangeTypeFetchData];
112- displayIndexPaths = [_layoutController indexPathsForScrolling: _scrollDirection rangeType: ASLayoutRangeTypeDisplay];
112+
113+ ASRangeTuningParameters parametersFetchData = [_layoutController tuningParametersForRangeType: ASLayoutRangeTypeFetchData];
114+ ASRangeTuningParameters parametersDisplay = [_layoutController tuningParametersForRangeType: ASLayoutRangeTypeDisplay];
115+ if (parametersDisplay.leadingBufferScreenfuls == parametersFetchData.leadingBufferScreenfuls &&
116+ parametersDisplay.trailingBufferScreenfuls == parametersFetchData.trailingBufferScreenfuls ) {
117+ displayIndexPaths = fetchDataIndexPaths;
118+ } else {
119+ displayIndexPaths = [_layoutController indexPathsForScrolling: _scrollDirection rangeType: ASLayoutRangeTypeDisplay];
120+ }
113121
114122 // Typically the fetchDataIndexPaths will be the largest, and be a superset of the others, though it may be disjoint.
115123 // Because allIndexPaths is an NSMutableOrderedSet, this adds the non-duplicate items /after/ the existing items.
You can’t perform that action at this time.
0 commit comments