Initializer

init(_:selection:columns:)

Creates a table that computes its rows based on a collection of identifiable data, and that supports selecting zero or one row.

Declaration 宣言

init<Data>(_ data: Data, selection: Binding<Value.ID?>, columns: () -> Columns) where Rows == TableForEachContent<Data>, Data : RandomAccessCollection, Columns.TableRowValue == Data.Element
Available when Value is Rows.TableRowValue, Rows conforms to TableRowContent, Columns conforms to TableColumnContent, and Rows.TableRowValue is Columns.TableRowValue.

Parameters パラメータ

data

The identifiable data for computing the table rows.

selection

A binding to the optional selected row id.

columns

The columns to display in the table.

See Also 参照

Creating a Table from Columns