ASDisplayNode(UIViewBridge) Category Reference
ASDisplayNode provides thread-safe access to most of UIView and CALayer properties and methods, traditionally unsafe.
Using them will not cause the actual view/layer to be created, and will be applied when it is created (when the view or layer property is accessed).
- NOTE: After the view or layer is created, the properties pass through to the view or layer directly and must be called on the main thread.
See UIView and CALayer for documentation on these common properties.
Marks the view as needing display. Convenience for use whether the view / layer is loaded or not. Safe to call from a background thread.
Marks the node as needing layout. Convenience for use whether the view / layer is loaded or not. Safe to call from a background thread.
If this node was measured, calling this method triggers an internal relayout: the calculated layout is invalidated, and the supernode is notified or (if this node is the root one) a full measurement pass is executed using the old constrained size.
Note: ASCellNode has special behavior in that calling this method will automatically notify the containing ASTableView / ASCollectionView that the cell should be resized, if necessary.
The node view’s background color.
@property (nonatomic, strong, nullable) UIColor *backgroundColor
In contrast to UIView, setting a transparent color will not set opaque = NO. This only affects nodes that implement +drawRect like ASTextNode.
A flag used to determine how a node lays out its content when its bounds change.
@property (nonatomic, assign) UIViewContentMode contentMode
This is like UIView’s contentMode property, but better. We do our own mapping to layer.contentsGravity in _ASDisplayView. You can set needsDisplayOnBoundsChange independently. Thus, UIViewContentModeRedraw is not allowed; use needsDisplayOnBoundsChange = YES instead, and pick an appropriate contentMode for your content while it’s being re-rendered.