Contents

init(_:children:sortOrder:columnCustomization:columns:)

Creates a sortable, hierarchical table that computes its rows based on a collection of identifiable data and key path to the children of that data.

Declaration

nonisolated init<Data, Sort>(_ data: Data, children: KeyPath<Data.Element, Data?>, sortOrder: Binding<[Sort]>, columnCustomization: Binding<TableColumnCustomization<Value>>? = nil, @TableColumnBuilder<Value, Sort> columns: () -> Columns) where Rows == TableOutlineGroupContent<Data>, Data : RandomAccessCollection, Sort : SortComparator, Columns.TableRowValue == Data.Element, Data.Element == Sort.Compared

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.

  • sortOrder:

    A binding to the ordered sorting of columns.

  • 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