mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-27 02:24:15 +08:00
[ASRangeControllerBeta] Add tracking of all index paths that have .interfaceState set, ensure updating.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user