init(_:id:rowContent:)
Creates a list that identifies its rows based on a key path to the identifier of the underlying data.
Declaration
@MainActor @preconcurrency init<Data, ID, RowContent>(_ data: Data, id: KeyPath<Data.Element, ID>, @ViewBuilder rowContent: @escaping (Data.Element) -> RowContent) where Content == ForEach<Data, ID, RowContent>, Data : RandomAccessCollection, ID : Hashable, RowContent : ViewParameters
- data:
The data for populating the list.
- id:
The key path to the data model’s identifier.
- rowContent:
A view builder that creates the view for a single row of the list.