@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?
@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-didEnterPreloadStateofASCellNode, 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?