Initializer

init(_:children:selection:rowContent:)

Creates a hierarchical list that computes its rows on demand from an underlying collection of identifiable data, optionally allowing users to select multiple rows.

Declaration 宣言

init<Data, RowContent>(_ data: Data, children: KeyPath<Data.Element, Data?>, selection: Binding<Set<SelectionValue>>?, rowContent: @escaping (Data.Element) -> RowContent) where Content == OutlineGroup<Data, Data.Element.ID, RowContent, RowContent, DisclosureGroup<RowContent, OutlineSubgroupChildren>>, Data : RandomAccessCollection, RowContent : View, Data.Element : Identifiable
Available when SelectionValue conforms to Hashable and Content conforms to View.

Parameters パラメータ

data

The identifiable data for computing the list. リストを計算するための身元識別可能データ。

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.

selection

A binding to a set that identifies selected rows. ある集合へのバインディング、それは選択された行を識別します。

rowContent

A view builder that creates the view for a single row of the list. あるビュービルダー、それはリストの単一の行に対するビューを作成します。

See Also 参照

Listing Hierarchical Data