Added navigation and tab views
This commit is contained in:
		
							
								
								
									
										18
									
								
								WordAX/AnkiView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								WordAX/AnkiView.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| // | ||||
| //  AnkiView.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 23.02.2024. | ||||
| // | ||||
|  | ||||
| import SwiftUI | ||||
|  | ||||
| struct AnkiView: View { | ||||
|     var body: some View { | ||||
|         Text("This is Anki View") | ||||
|     } | ||||
| } | ||||
|  | ||||
| #Preview { | ||||
|     AnkiView() | ||||
| } | ||||
| @@ -1,24 +0,0 @@ | ||||
| // | ||||
| //  ContentView.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 19.02.2024. | ||||
| // | ||||
|  | ||||
| import SwiftUI | ||||
|  | ||||
| struct ContentView: View { | ||||
|     var body: some View { | ||||
|         VStack { | ||||
|             Image(systemName: "globe") | ||||
|                 .imageScale(.large) | ||||
|                 .foregroundStyle(.tint) | ||||
|             Text("Hello, world!") | ||||
|         } | ||||
|         .padding() | ||||
|     } | ||||
| } | ||||
|  | ||||
| #Preview { | ||||
|     ContentView() | ||||
| } | ||||
							
								
								
									
										42
									
								
								WordAX/MainView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								WordAX/MainView.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| // | ||||
| //  ContentView.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 19.02.2024. | ||||
| // | ||||
|  | ||||
| import SwiftUI | ||||
|  | ||||
| struct MainView: View { | ||||
|     @State var selectedTab = "Anki" | ||||
|     init() { | ||||
|         UITabBar.appearance().backgroundColor = UIColor.systemGray5 | ||||
|     } | ||||
|     var body: some View { | ||||
|         ZStack { | ||||
|             TabView(selection: $selectedTab) { | ||||
|                 Group { | ||||
|                     AnkiView() | ||||
|                         .tag("Anki") | ||||
|                         .tabItem { | ||||
|                             Image(systemName: "star") | ||||
|                             Text("Anki") | ||||
|                         } | ||||
|                     SettingsView() | ||||
|                         .tag("Settings") | ||||
|                         .tabItem { | ||||
|                             Image(systemName: "gear") | ||||
|                             Text("Settings") | ||||
|                         } | ||||
|                 } | ||||
|                 .toolbar(.visible, for: .tabBar) | ||||
|                 .toolbarBackground(Color.yellow, for: .tabBar) | ||||
|             } | ||||
|         } | ||||
|          | ||||
|     } | ||||
| } | ||||
|  | ||||
| #Preview { | ||||
|     MainView() | ||||
| } | ||||
							
								
								
									
										18
									
								
								WordAX/SettingsView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								WordAX/SettingsView.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| // | ||||
| //  SettingsView.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 23.02.2024. | ||||
| // | ||||
|  | ||||
| import SwiftUI | ||||
|  | ||||
| struct SettingsView: View { | ||||
|     var body: some View { | ||||
|         Text("This is settings") | ||||
|     } | ||||
| } | ||||
|  | ||||
| #Preview { | ||||
|     SettingsView() | ||||
| } | ||||
							
								
								
									
										8
									
								
								WordAX/WordAX.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								WordAX/WordAX.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| // | ||||
| //  WordAX.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 23.02.2024. | ||||
| // | ||||
|  | ||||
| import Foundation | ||||
							
								
								
									
										8
									
								
								WordAX/WordAXModel.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								WordAX/WordAXModel.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| // | ||||
| //  WordAXModel.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 23.02.2024. | ||||
| // | ||||
|  | ||||
| import Foundation | ||||
							
								
								
									
										8
									
								
								WordAX/WordAXModelView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								WordAX/WordAXModelView.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| // | ||||
| //  WordAXModelView.swift | ||||
| //  WordAX | ||||
| // | ||||
| //  Created by Oliver Hnát on 23.02.2024. | ||||
| // | ||||
|  | ||||
| import Foundation | ||||
		Reference in New Issue
	
	Block a user