<!--
{
  "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:)-2bobo",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ListV_9selection10rowContentACyxAA7ForEachVySnySiGSiAA6HStackVyqd__GGGAH_AA7BindingVyShyxGGSgqd__SictcALRs_AA4ViewRd__lufc"
  },
  "title" : "init(_:selection:rowContent:)"
}
-->

# init(_:selection:rowContent:)

Creates a list that computes its views on demand over a constant range,
optionally allowing users to select multiple rows.

```
nonisolated init<RowContent>(_ data: Range<Int>, selection: Binding<Set<SelectionValue>>?, @ContentBuilder rowContent: @escaping (Int) -> RowContent) where Content == ForEach<Range<Int>, Int, HStack<RowContent>>, RowContent : View
```

## Parameters

`data`

A constant range of data to populate the list.

`selection`

A binding to a set that identifies selected rows.

`rowContent`

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

## Discussion

This instance only reads the initial value of `data` and doesn’t need to
identify views across updates. To compute views on demand over a dynamic
range, use `List/init(_:id:selection:rowContent:)`.

---

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)