Initializer

init(_:selection:sortOrder:columns:)

Creates a sortable table that computes its rows based on a collection of identifiable data, and that supports selecting multiple rows.

Declaration 宣言

init<Data, Sort>(_ data: Data, selection: Binding<Set<Value.ID>>, sortOrder: Binding<[Sort]>, columns: () -> Columns) where Rows == TableForEachContent<Data>, Data : RandomAccessCollection, Sort : SortComparator, Columns.TableRowValue == Data.Element, Data.Element == Sort.Compared
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 a set that identifies selected rows ids.

sortOrder

A binding to the ordered sorting of columns.

columns

The columns to display in the table.

See Also 参照

Creating a Sortable Table from Columns