You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
[ASDisplayNode] Trigger a layout pass whenever a node enters preload state (#3263)
* Add a thread-safe layoutIfNeeded implementation to ASDisplayNode
* Trigger a layout pass when a display node enters preload state
- This ensures that all the subnodes have the correct size to preload their content.
* ASCollectionNode to trigger its initial data load when it enters preload state
* Minor change in _ASCollectionViewCell
* Layout sublayouts before dispatch to main for subclass hooks
* Update comments
* Don't wait until updates are committed when the collection node enters display state
* Same deal for table node
* Explain the layout trigger in ASDisplayNode
* This category implements certain frequently-used properties and methods of UIView and CALayer so that ASDisplayNode clients can just call the view/layer methods on the node,
86
83
* with minimal loss in performance. Unlike UIView and CALayer methods, these can be called from a non-main thread until the view or layer is created.
// Message the view or layer which in turn will call __layout on us (see -[_ASDisplayLayer layoutSublayers]).
386
+
[viewOrLayer layoutIfNeeded];
387
+
} elseif (loaded) {
388
+
// The node is loaded but we're not on main.
389
+
// We will call layoutIfNeeded on the view or layer when we apply the pending state. __layout will in turn be called on us (see -[_ASDisplayLayer layoutSublayers]).
390
+
// We need to call it on main if the node is loaded to support automatic subnode management.
0 commit comments