Initializer

init(_:children:rowContent:)

Creates a hierarchical list that computes its rows on demand from an underlying collection of identifiable data.

Declaration 宣言

init<Data, RowContent>(_ data: Data, children: KeyPath<Data.Element, Data?>, 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 is Never and Content conforms to View.

Parameters パラメータ

data

A collection of 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.

rowContent

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

See Also 参照

Listing Hierarchical Data