mirror of
https://github.com/TextureGroup/Texture.git
synced 2026-04-07 19:17:39 +00:00
Force -[_ASDisplayLayer setDelegate:] to evaluate delegateFlags in iOS13. (#1609)
It appears that UIKit might be setting the delegate ivar directly which bypasses establishing the `_delegateFlags` ivar on `ASDisplayLayer`. This is critical for things like ASPagerNode, ASCollectionNode that depend on layer delegateFlags to forward bounds changes. Radar filed: FB6956185
This commit is contained in:
committed by
Garrett Moon
parent
3a3e574ef0
commit
ae00a9053d
@@ -530,7 +530,6 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__);
|
||||
- (void)_locked_loadViewOrLayer
|
||||
{
|
||||
DISABLED_ASAssertLocked(__instanceLock__);
|
||||
|
||||
if (_flags.layerBacked) {
|
||||
TIME_SCOPED(_debugTimeToCreateView);
|
||||
_layer = [self _locked_layerToLoad];
|
||||
@@ -550,6 +549,14 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__);
|
||||
_view = [self _locked_viewToLoad];
|
||||
_view.asyncdisplaykit_node = self;
|
||||
_layer = _view.layer;
|
||||
// Needed to force `-[_ASDisplayLayer setDelegate:]` to evaluate
|
||||
// It appears that UIKit might be setting the delegate ivar directly which
|
||||
// bypasses establishing the `_delegateFlags` ivar on `ASDisplayLayer`
|
||||
// This is critical for things like ASPagerNode, ASCollectionNode that depend
|
||||
// on layer delegateFlags to forward bounds changes
|
||||
if (_layer.delegate == _view) {
|
||||
[_layer setDelegate:_view];
|
||||
}
|
||||
}
|
||||
_layer.asyncdisplaykit_node = self;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user