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

TableState

Row/mark selection, optional cell selection, and two-axis scrolling owned by the caller.

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

TableState

Structure
struct TableState<ID> where ID : Hashable

Conforms to: Swift.Sendable, Swift.SendableMetatype.

Row/mark selection, optional cell selection, and two-axis scrolling owned by the caller.

Source · Table.swift:53

rows

Instance Property
var rows: SelectionState<ID>

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Table.swift:54

horizontal

Instance Property
var horizontal: ScrollState

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Table.swift:55

selectedColumn

Instance Property
var selectedColumn: Int? { get }

A public field of this type. Its value type and mutability are shown in the declaration.

Source · Table.swift:56

highlightedColumn

Instance Property
var highlightedColumn: Int? { get }

A whole-column highlight independent of the selected cell.

Source · Table.swift:58

init(selectedID:selectedColumn:)

Initializer
init(selectedID: ID? = nil, selectedColumn: Int? = nil)

Creates a value with the supplied arguments. Default arguments are shown in the declaration.

Parameters (2)
selectedID
Argument type and any default are shown in the declaration; see the behavior notes above.
selectedColumn
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Table.swift:61

highlightColumn(_:)

Instance Method
mutating func highlightColumn(_ column: Int?)

Sets the highlighted column independently of the selected body cell.

Parameters (1)
column
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Table.swift:66

selectColumn(_:)

Instance Method
mutating func selectColumn(_ column: Int?)

Selects a column and reveals it horizontally using synchronized column metrics.

Parameters (1)
column
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Table.swift:76

selectCell(row:column:)

Instance Method
mutating func selectCell(row: ID, column: Int)

Selects a stable row and a column, revealing both with the current metrics.

Parameters (2)
row
Document row coordinate.
column
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Table.swift:86

moveColumn(by:)

Instance Method
mutating func moveColumn(by distance: Int)

Moves the selected column by signed steps and reveals it horizontally.

Parameters (1)
by
Argument type and any default are shown in the declaration; see the behavior notes above.
Source · Table.swift:91

handle(_:allowsMultipleSelection:)

Instance Method
@discardableResult mutating func handle(_ event: InputEvent, allowsMultipleSelection: Bool = false) -> Bool

Up/down navigate rows; left/right navigate an active cell selection or scroll horizontally.

Parameters (2)
event
Argument type and any default are shown in the declaration; see the behavior notes above.
allowsMultipleSelection
Argument type and any default are shown in the declaration; see the behavior notes above.

Returns Bool.

Source · Table.swift:103