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

-tintColorDidChange will not be called if the color is changed before a layer-backed node loads #1621

Open
nguyenhuy opened this issue Aug 15, 2019 · 0 comments

Comments

@nguyenhuy
Copy link
Member

nguyenhuy commented Aug 15, 2019

After #1620, developers can expect that:

  • Change tint color after a view-backed node loaded: tintColorDidChange will be called immediately.
  • Change tint color before a view-backed node loads: tintColorDidChange will be called when the node loads. This is because when we load the node's view and apply pending state to it, the view will call tintColorDidChange on itself which will call the node's counterpart (see -[_ASDisplayView tintColorDidChange]).
  • Change tint color after a layer-backed node loaded: tintColorDidChange will be called immediately.
  • Change tint color before a layer-backed node loads: tintColorDidChange will not be called, even when the node loads.

A more developer-friendly API should make sure the same behavior applies regardless of whether the node is view-backed or layer-backed.

We should also see if we can support the same behaviors for wrapper nodes (nodes that wrap around normal UIView objects via -initWithViewBlock:). Our -[_ASDisplayView tintColorDidChange] hook doesn't work in this case, so we may have to swizzle.

@nguyenhuy nguyenhuy changed the title tintColorDidChange is not called if the color is changed before a layer-backed node is loaded tintColorDidChange will not be called if the color is changed before a layer-backed node is loaded Aug 15, 2019
@nguyenhuy nguyenhuy changed the title tintColorDidChange will not be called if the color is changed before a layer-backed node is loaded -tintColorDidChange will not be called if the color is changed before a layer-backed node is loaded Aug 15, 2019
@nguyenhuy nguyenhuy changed the title -tintColorDidChange will not be called if the color is changed before a layer-backed node is loaded -tintColorDidChange will not be called if the color is changed before a layer-backed node loads Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant