Initializer

init(_:id:content:)

Creates an instance that uniquely identifies and creates table rows across updates based on the provided key path to the underlying data’s identifier.

Declaration 宣言

init<V>(_ data: Data, id: KeyPath<Data.Element, ID>, content: @escaping (Data.Element) -> Content) where V == Content.TableRowValue
Available when Data conforms to RandomAccessCollection, ID conforms to Hashable, and Content conforms to TableRowContent.

Parameters パラメータ

data

The data that the ForEach instance uses to create table rows dynamically.

id

The key path to the provided data’s identifier. 提供されたデータのもつ識別子へのキーパス。

content

The table row builder that creates rows dynamically.

See Also 参照

Creating a Collection of Table Rows