Added navigation and tab views

This commit is contained in:
2024-02-23 14:17:03 +01:00
parent f96f2df580
commit c253938cb9
8 changed files with 122 additions and 28 deletions

18
WordAX/AnkiView.swift Normal file
View 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()
}

View File

@@ -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
View 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
View 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
View 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
View File

@@ -0,0 +1,8 @@
//
// WordAXModel.swift
// WordAX
//
// Created by Oliver Hnát on 23.02.2024.
//
import Foundation

View File

@@ -0,0 +1,8 @@
//
// WordAXModelView.swift
// WordAX
//
// Created by Oliver Hnát on 23.02.2024.
//
import Foundation