init(_:children:selection:columnCustomization:columns:)
Creates a hierarchical table that computes its rows based on a collection of identifiable data and key path to the children of that data, and supports selecting multiple rows.
Declaration
nonisolated init<Data>(_ data: Data, children: KeyPath<Data.Element, Data?>, selection: Binding<Set<Value.ID>>, columnCustomization: Binding<TableColumnCustomization<Value>>? = nil, @TableColumnBuilder<Value, Never> columns: () -> Columns) where Rows == TableOutlineGroupContent<Data>, Data : RandomAccessCollection, Columns.TableRowValue == Data.ElementParameters
- data:
The identifiable data for computing the table rows.
- children:
A key path to a property whose non-
nilvalue gives the children ofdata, and whosenilvalue represents a leaf row of the hierarchy, which is not capable of having children. - selection:
A binding to a set that identifies selected rows IDs.
- columnCustomization:
A binding to the state of columns.
- columns:
The columns to display in the table.
Discussion
Each column in the table that should participate in customization is required to have an identifier, specified with customizationID(_:).