Created
October 3, 2020 14:34
-
-
Save rudrankriyam/53ee8ffdd2c1e294347560dc962a4267 to your computer and use it in GitHub Desktop.
The old tab view of Gradient Game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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