Contents

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.Element

Parameters

  • data:

    The identifiable data for computing the table rows.

  • children:

    A key path to a property whose non-nil value gives the children of data, and whose nil value 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(_:).

See Also

Creating a hierarchical table