protocol AnyViewNode
Swift
protocol AnyViewNode : AnyObject
A node in the retained tree: what a view mounts into and is reconciled against.
Views are rebuilt every frame; nodes persist, own the Yoga layout box and
the visual state, and keep their id for as long as they live. Apps meet
nodes through PrimitiveMount and the layout queries on LayoutHost.
Sources/LavaUI/LayoutNode.swift:65
Properties
var agentId: String? { get set }
Author-assigned agent id (.agentId("…")). Stable across process runs.
Prefer this over process-local id when scripting the UI.
Sources/LavaUI/LayoutNode.swift:79
var childNodes: [any AnyViewNode] { get }
Direct retained children (not flattened).
Sources/LavaUI/LayoutNode.swift:73
var id: NodeID { get }
This node's identity, stable for its whole life.
Sources/LavaUI/LayoutNode.swift:67
var label: String { get }
A short name for the node, shown in the layout tree and dumps.
Sources/LavaUI/LayoutNode.swift:69
var needsBodyRecompute: Bool { get set }
True while this node's body is being re-evaluated. Always false for primitives.
Sources/LavaUI/LayoutNode.swift:75
var structuralKey: String? { get set }
Path segment override (e.g. ForEach element key). Used when building
structural sid fallbacks for untagged nodes.
Sources/LavaUI/LayoutNode.swift:83
var yoga: YGNodeRef? { get }
Non-nil for layout boxes (stacks, text, spacer…). Nil for fragments.
Sources/LavaUI/LayoutNode.swift:71
Methods
func collectFrames(originX: Float, originY: Float, into: inout [LayoutFrame])
Appends this node's frame, and its subtree's, to into, offset by the origin.
Sources/LavaUI/LayoutNode.swift:86