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 @@ -1770,6 +1770,10 @@ - (void)setInterfaceState:(ASInterfaceState)newState
17701770 // Trigger asynchronous measurement if it is not already cached or being calculated.
17711771 }
17721772
1773+ // For the FetchData and Display ranges, we don't want to call -clear* if not being managed by a range controller.
1774+ // Otherwise we get flashing behavior from normal UIKit manipulations like navigation controller push / pop.
1775+ // Still, the interfaceState should be updated to the current state of the node; just don't act on the transition.
1776+
17731777 // Entered or exited data loading state.
17741778 if ((newState & ASInterfaceStateFetchData) != (oldState & ASInterfaceStateFetchData)) {
17751779 if (newState & ASInterfaceStateFetchData) {
Original file line number Diff line number Diff line change @@ -1702,7 +1702,11 @@ - (void)testInterfaceStateForNonCellNode
17021702 XCTAssert (node.interfaceState == ASInterfaceStateInHierarchy);
17031703
17041704 [node.view removeFromSuperview ];
1705- XCTAssert (!node.hasFetchedData );
1705+ // We don't want to call -clearFetchedData on nodes that aren't being managed by a range controller.
1706+ // Otherwise we get flashing behavior from normal UIKit manipulations like navigation controller push / pop.
1707+ // Still, the interfaceState should be None to reflect the current state of the node.
1708+ // We just don't proactively clear contents or fetched data for this state transition.
1709+ XCTAssert (node.hasFetchedData );
17061710 XCTAssert (node.interfaceState == ASInterfaceStateNone);
17071711}
17081712
You can’t perform that action at this time.
0 commit comments