Contents

init(_:children:)

Creates an outline group from a collection of root data elements and a key path to element’s children.

Declaration

init<DataElement>(_ data: Data, children: KeyPath<DataElement, Data?>) where ID == DataElement.ID, Parent == TableRow<DataElement>, Leaf == TableRow<DataElement>, Subgroup == TableRow<DataElement>, DataElement : Identifiable, DataElement == Data.Element

Parameters

  • data:

    A collection of tree-structured, identified data.

  • children:

    A key path to a property whose non-nil value gives the children of data. A non-nil but empty value denotes an element capable of having children that’s currently childless, such as an empty directory in a file system. On the other hand, if the property at the key path is nil, then the outline group treats data as a leaf in the tree, like a regular file in a file system.

Discussion

This initializer provides a default TableRowBuilder using TableRow for each data element.

This initializer creates an instance that uniquely identifies table rows across updates based on the identity of the underlying data element.

All generated disclosure groups begin in the collapsed state.

See Also

Creating an outline group