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

Commit 55861b3

Browse files
author
Scott Goodson
committed
Update the expectations of the tests now that the clearContents behavior is corrected.
1 parent 93498d8 commit 55861b3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

AsyncDisplayKitTests/ASDisplayNodeTests.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)