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
Comments
@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. |
…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.
…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.
@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
ofASCellNode
, 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?
The text was updated successfully, but these errors were encountered: