---
title: "init(selection:content:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/tabview/init(selection:content:)"
---

# init(selection:content:)

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

## Declaration

```swift
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 doc://com.apple.SwiftUI/documentation/SwiftUI/Tab content.

## See Also

### Creating a tab view

- [init(content:)](swiftui/tabview/init(content:).md)
