DHBW-Service-App/DHBW-Service/Views/ContentView.swift

48 lines
1.1 KiB
Swift
Raw Normal View History

2020-12-21 19:28:01 +00:00
//
// ContentView.swift
// DHBW-Service
//
// Created by Patrick Müller on 20.12.20.
//
import SwiftUI
import CoreData
struct ContentView: View {
2020-12-21 19:54:59 +00:00
@EnvironmentObject var settings: LocalSettings
2020-12-21 19:28:01 +00:00
@State private var selection = 0
var body: some View {
2020-12-21 19:54:59 +00:00
Group {
if(!settings.isFirstOpening) {
TabView(selection: $selection) {
HomeView()
.tabItem {
VStack {
Image(systemName: "house.fill")
Text("Home")
}
}
.tag(0)
2020-12-21 19:28:01 +00:00
}
2020-12-21 19:54:59 +00:00
} else {
Button(action: {
self.settings.isFirstOpening = !self.settings.isFirstOpening
}){
Text("First opening toggle")
}
}
2020-12-21 19:28:01 +00:00
}
}
}
2020-12-21 19:54:59 +00:00
extension ContentView{
}
2020-12-21 19:28:01 +00:00
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.preferredColorScheme(.dark)
}
}