Initializer

init(_:children:selection:rowContent:)

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

Declaration 宣言

init<Data, RowContent>(_ data: Binding<Data>, children: WritableKeyPath<Data.Element, Data?>, selection: Binding<SelectionValue?>?, rowContent: @escaping (Binding<Data.Element>) -> RowContent) where Content == OutlineGroup<Binding<Data>, Data.Element.ID, RowContent, RowContent, DisclosureGroup<RowContent, OutlineSubgroupChildren>>, Data : MutableCollection, 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 a node capable of having children that is 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 data is treated as a leaf node in the tree, like a regular file in a file system.

selection

A binding to a selected value. 選択された値へのあるバインディング。

rowContent

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

See Also 参照

Listing Bound, Hierarchical Data