Skip to content

Instantly share code, notes, and snippets.

@simonnickel
Created November 4, 2024 17:07
Show Gist options
  • Save simonnickel/68d532f48cfd0f6d4b8228cc0e0df7c8 to your computer and use it in GitHub Desktop.
Save simonnickel/68d532f48cfd0f6d4b8228cc0e0df7c8 to your computer and use it in GitHub Desktop.
enum AppDestination: String {
case rectangle
case circle
}
struct ContentView: View {
@State private var selected: AppDestination = .circle
var body: some View {
TabView(selection: $selected) {
Tab(value: .circle) {
Text("Some Text for Circle")
} label: {
Label {
Text("Circle")
} icon: {
Image(systemName: "circle")
}
}
Tab(value: .rectangle) {
Text("Some Text for Rectangle")
} label: {
Label {
Text("Rectangle")
} icon: {
Image(systemName: "rectangle")
}
}
}
.tabViewStyle(.sidebarAdaptable)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment