<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TabView/init(selection:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7TabViewV9selection7contentACyxAA0C14ContentBuilderV0G0Vyx_qd__GGAA7BindingVyxG_qd__yXEtcAJRs_AA0cG0Rd__lufc::OverloadGroup"
  },
  "title" : "init(selection:content:)"
}
-->

# init(selection:content:)

Creates a tab view that uses a builder to create and specify
selection values for its tabs.

```
nonisolated init<C>(selection: Binding<SelectionValue>, @TabContentBuilder<SelectionValue> content: () -> C) where Content == TabContentBuilder<SelectionValue>.Content<C>, C : TabContent
```

## Parameters

`selection`

The selection in the TabView. The value of this
binding must match the `value` of the tabs in `content`.

`content`

The [`Tab`](/documentation/SwiftUI/Tab) content.

---

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)