Skip to content

Instantly share code, notes, and snippets.

@rudrankriyam
Created October 3, 2020 14:34
Show Gist options
  • Select an option

  • Save rudrankriyam/53ee8ffdd2c1e294347560dc962a4267 to your computer and use it in GitHub Desktop.

Select an option

Save rudrankriyam/53ee8ffdd2c1e294347560dc962a4267 to your computer and use it in GitHub Desktop.
The old tab view of Gradient Game
import SwiftUI
struct MainView : View {
@State private var currentTab: Int = 1
var body: some View {
TabView(selection: $currentTab) {
RGBView()
.tabItem {
Image(systemName: "circle.grid.hex")
.font(.system(size: 20))
Text("RGB")
.kerning(1)
}
.tag(1)
HSBView()
.tabItem {
Image(systemName: "circle.grid.2x2")
.font(.system(size: 20))
Text("HSB")
.kerning(1)
}
.tag(2)
HistoryView()
.navigationViewStyle(StackNavigationViewStyle())
.tabItem {
Image(systemName: "doc.text")
.font(.system(size: 20))
Text("HISTORY")
.kerning(1)
}
.tag(3)
SettingsView()
.navigationViewStyle(StackNavigationViewStyle())
.tabItem {
Image(systemName: "gear")
.font(.system(size: 20))
Text("SETTINGS")
.kerning(1)
}
.tag(4)
}
.accentColor(.mainColor)
}
init() {
let appearance = UITabBar.appearance()
appearance.barStyle = .black
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment