<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/List/init(_:selection:rowContent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ListV_9selection10rowContentACyxAA7ForEachVys15LazyMapSequenceVy7IndicesSlQyd__5IndexSlQyd___7ElementST_2IDQYd__tGAPqd_0_GGAA7BindingVyqd__G_AUyxSgGSgqd_0_AUyANSTQyd__GctcARRs_SMRd__SkRd__AA4ViewRd_0_s12IdentifiableAZRQSHAMRQr0_lufc::OverloadGroup"
  },
  "title" : "init(_:selection:rowContent:)"
}
-->

# 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.

```
@export(implementation) nonisolated init<Data, RowContent>(_ data: Binding<Data>, selection: Binding<SelectionValue?>?, @ContentBuilder 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 content builder that creates the view for a single row of
the list.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)