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

Automatic subnode management (ASM) and node interface states #693

Closed
nguyenhuy opened this issue Nov 28, 2017 · 1 comment
Closed

Automatic subnode management (ASM) and node interface states #693

nguyenhuy opened this issue Nov 28, 2017 · 1 comment

Comments

@nguyenhuy
Copy link
Member

@maicki and I are facing a problem in which subnodes of an ASM-enabled node have not been inserted into the supernode by the time the supernode enters the visible state. That is because ASM inserts new nodes when the pending layout is applied. Once the nodes are inserted, they'll also get the interface states of the supernode, all in one go, and start playing catch-up.

One solution is to call -[ASDisplayNode layoutIfNeeded] in -didEnterPreloadState of ASCellNode, if the cell node uses ASM. Since cell nodes are guaranteed to have their calculated layout by the time they enter the preload range, running a layout pass there shouldn't introduce significant overheads. On the other hand, doing so ensures that all subnodes are inserted at the right time and can start preloading their contents much sooner than the current implementation.

@appleguy @maicki @Adlai-Holler @garrettmoon Any thoughts?

@appleguy
Copy link
Member

@nguyenhuy @maicki we should attempt to do the layoutIfNeeded-like flush without triggering the creation of views and layers. That is, make the add/remove subnode calls and set bounds/center (or frame) values, but not depend on calling the actual -[CALayer layoutIfNeeded].

Does this seem like a good solution? Because ASM is now very common, implementing this would be a good way to ensure it benefits from preloading as much as non-ASM nodes always have.

nguyenhuy added a commit to nguyenhuy/Texture that referenced this issue Dec 7, 2017
…load state

This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes TextureGroup#693.
nguyenhuy added a commit that referenced this issue Dec 8, 2017
…load state (#706)

This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes #693.
bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
…load state (TextureGroup#706)

This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes TextureGroup#693.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants