[ASRangeControllerBeta] Add tracking of all index paths that have .interfaceState set, ensure updating.

This commit is contained in:
Scott Goodson
2016-01-05 23:17:54 -08:00
parent 8a5f080fcc
commit d1c3894dbb

View File

@@ -37,6 +37,7 @@ extern BOOL ASInterfaceStateIncludesFetchData(ASInterfaceState interfaceState)
BOOL _rangeIsValid;
BOOL _queuedRangeUpdate;
ASScrollDirection _scrollDirection;
NSMutableSet *_allPreviousIndexPaths;
}
@end
@@ -112,6 +113,12 @@ extern BOOL ASInterfaceStateIncludesFetchData(ASInterfaceState interfaceState)
[allIndexPaths unionSet:displayIndexPaths];
[allIndexPaths unionSet:visibleIndexPaths];
// Sets are magical. Add anything we had applied interfaceState to in the last update, so we can clear any
// range flags it still has enabled. Most of the time, all but a few elements are equal; a large programmatic
// scroll or major main thread stall could cause entirely disjoint sets, but we must visit all.
[allIndexPaths unionSet:_allPreviousIndexPaths];
_allPreviousIndexPaths = allIndexPaths;
for (NSIndexPath *indexPath in allIndexPaths) {
// Before a node / indexPath is exposed to ASRangeController, ASDataController should have already measured it.
// For consistency, make sure each node knows that it should measure itself if something changes.