Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created June 23, 2020 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anupamchugh/b35af7c6e71fedc88bc45e8a828bf556 to your computer and use it in GitHub Desktop.
Save anupamchugh/b35af7c6e71fedc88bc45e8a828bf556 to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
let colors: [Color] = [.red, .green, .yellow, .blue]
var body: some View {
TabView {
ForEach(0..<6) { index in
Text("Tab \(index)")
.font(.title)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(colors[index % colors.count])
.cornerRadius(8)
}
}.tabViewStyle(PageTabViewStyle())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment