Contents

init(_:selection:rowContent:)

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

Declaration

@MainActor @preconcurrency init<Data, RowContent>(_ data: Binding<Data>, selection: Binding<SelectionValue?>?, @ViewBuilder rowContent: @escaping (Binding<Data.Element>) -> RowContent) where Content == ForEach<LazyMapSequence<Data.Indices, (Data.Index, Data.Element.ID)>, Data.Element.ID, RowContent>, Data : MutableCollection, Data : RandomAccessCollection, RowContent : View, Data.Element : Identifiable, Data.Index : Hashable

Parameters

  • data:

    The identifiable data for computing the list.

  • selection:

    A binding to a selected value.

  • rowContent:

    A view builder that creates the view for a single row of the list.

See Also

Creating a list from enumerated data