@@ -1770,23 +1770,31 @@ - (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) {
17761780 [self fetchData ];
17771781 } else {
1778- [self clearFetchedData ];
1782+ if ([self supportsRangeManagedInterfaceState ]) {
1783+ [self clearFetchedData ];
1784+ }
17791785 }
17801786 }
17811787
17821788 // Entered or exited contents rendering state.
17831789 if ((newState & ASInterfaceStateDisplay) != (oldState & ASInterfaceStateDisplay)) {
1784- if (newState & ASInterfaceStateDisplay) {
1785- // Once the working window is eliminated (ASRangeHandlerRender), trigger display directly here.
1786- [self setDisplaySuspended: NO ];
1787- } else {
1788- [self setDisplaySuspended: YES ];
1789- [self clearContents ];
1790+ if ([self supportsRangeManagedInterfaceState ]) {
1791+ if (newState & ASInterfaceStateDisplay) {
1792+ // Once the working window is eliminated (ASRangeHandlerRender), trigger display directly here.
1793+ [self setDisplaySuspended: NO ];
1794+ } else {
1795+ [self setDisplaySuspended: YES ];
1796+ [self clearContents ];
1797+ }
17901798 }
17911799 }
17921800
0 commit comments