loom & weft
Made for Swift.

Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.

LOOM Unreleased (PR #2) / COLLECTIONS AND INTERACTION

StatefulWidget

A widget whose caller-owned state is synchronized with its rendered geometry.

State may update selection and scroll metrics during drawing. The widget never reads terminal events, starts tasks, or changes terminal modes.

Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.

Members on this page

Feature guides and release status

StatefulWidget

Protocol
protocol StatefulWidget

A widget whose caller-owned state is synchronized with its rendered geometry.

State may update selection and scroll metrics during drawing. The widget never reads terminal events, starts tasks, or changes terminal modes.

Source · StatefulWidget.swift:5

State

Associated Type
associatedtype State

The application-owned state passed by reference while this widget renders.

Source · StatefulWidget.swift:6

render(in:buffer:state:)

Instance Method
func render(in area: Rect, buffer: inout Buffer, state: inout State)

Paints using caller-owned state. Widgets may reconcile measurement/selection metrics but never consume input.

Parameters (3)
in
Argument type and any default are shown in the declaration; see the behavior notes above.
buffer
Mutable destination cell grid.
state
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · StatefulWidget.swift:7