diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index 6c7e3799c..a558193da 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -213,10 +213,10 @@ - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfac - (void)didEnterPreloadState { - // Intentionally allocate the view here so that super will trigger a layout pass on it which in turn will trigger the intial data load. - // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. - [self view]; [super didEnterPreloadState]; + // Intentionally allocate the view here and trigger a layout pass on it, which in turn will trigger the intial data load. + // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. + [[self view] layoutIfNeeded]; } #if ASRangeControllerLoggingEnabled diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 27fe8c9a9..95547a084 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2938,10 +2938,6 @@ - (void)didEnterPreloadState ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); [_interfaceStateDelegate didEnterPreloadState]; - // Trigger a layout pass to ensure all subnodes have the correct size to preload their content. - // This is important for image nodes, as well as collection and table nodes. - [self layoutIfNeeded]; - if (_methodOverrides & ASDisplayNodeMethodOverrideFetchData) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" diff --git a/Source/ASTableNode.mm b/Source/ASTableNode.mm index 3d0e8c57d..a6e7d8e97 100644 --- a/Source/ASTableNode.mm +++ b/Source/ASTableNode.mm @@ -142,10 +142,10 @@ - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfac - (void)didEnterPreloadState { - // Intentionally allocate the view here so that super will trigger a layout pass on it which in turn will trigger the intial data load. - // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. - [self view]; [super didEnterPreloadState]; + // Intentionally allocate the view here and trigger a layout pass on it, which in turn will trigger the intial data load. + // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. + [[self view] layoutIfNeeded]; } #if ASRangeControllerLoggingEnabled