Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force -[_ASDisplayLayer setDelegate:] to evaluate delegateFlags in iOS 13 #1609

Merged
merged 1 commit into from
Aug 8, 2019

Conversation

rahul-malik
Copy link
Contributor

@rahul-malik rahul-malik commented Aug 8, 2019

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

Resolves: #1595

…iOS13.

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
@nguyenhuy
Copy link
Member

LGTM, thanks for fixing this, @rahul-malik!

Rahul also raised a question about whether it's still worth it to cache the result of -respondsToSelector: (which is what -[_ASDisplayLayer setDelegate:] does). IIRC, the implementation of -respondsToSelector: is optimized now because it uses a cache itself internally. Perhaps something worth revisiting, @appleguy @Adlai-Holler @maicki?

@nguyenhuy nguyenhuy changed the title Force -[_ASDisplayLayer setDelegate:] to evaluate delegateFlags in … Force -[_ASDisplayLayer setDelegate:] to evaluate delegateFlags in iOS 13 Aug 8, 2019
@garrettmoon garrettmoon merged commit ae00a90 into master Aug 8, 2019
@Adlai-Holler
Copy link
Member

Adlai-Holler commented Aug 8, 2019 via email

@nguyenhuy
Copy link
Member

Great to know, thanks @Adlai-Holler!

nguyenhuy added a commit to nguyenhuy/Texture that referenced this pull request Aug 15, 2019
We rely on the delegate setter to be called to set the flag. However, recent change on iOS 13 causes the setter to not be called at all and thus we had to put up a workaround (TextureGroup#1609). While the workaround works, the perf benefit of that the flag provides doesn't warranty the extra complexity IMO. So I think we should just remove everything.
Adlai-Holler pushed a commit that referenced this pull request Aug 15, 2019
We rely on the delegate setter to be called to set the flag. However, recent change on iOS 13 causes the setter to not be called at all and thus we had to put up a workaround (#1609). While the workaround works, the perf benefit of that the flag provides doesn't warranty the extra complexity IMO. So I think we should just remove everything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[_ASDisplayLayer setDelegate:] is not called by UIViews
4 participants