You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.7 KiB
69 lines
1.7 KiB
//
|
|
// ContentView.swift
|
|
// TabBarProject
|
|
//
|
|
// Created by Arthur Dambrine on 06/04/2021.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
class User: ObservableObject {
|
|
@Published var score = 0
|
|
}
|
|
|
|
|
|
struct ContentView: View {
|
|
@State private var isShowingDetailView = false
|
|
@ObservedObject var user = User()
|
|
|
|
var body: some View {
|
|
|
|
NavigationView{
|
|
TabView {
|
|
|
|
ListCategoryView()
|
|
.tabItem {
|
|
Image(systemName: "phone.fill")
|
|
Text("First Tab")
|
|
}
|
|
|
|
Text("The content of the second view")
|
|
.tabItem {
|
|
Image(systemName: "tv.fill")
|
|
Text("Second Tab")
|
|
}
|
|
|
|
Text("The content of the Third view")
|
|
.tabItem {
|
|
Image(systemName: "circle.fill")
|
|
Text("Third Tab")
|
|
}
|
|
}
|
|
.navigationBarItems(
|
|
trailing: HStack {
|
|
NavigationLink(destination: SettingsView(), isActive: $isShowingDetailView){
|
|
EmptyView()
|
|
}
|
|
|
|
Button("Settings"){
|
|
isShowingDetailView.toggle()
|
|
}
|
|
}
|
|
|
|
|
|
)
|
|
.navigationBarTitle("Logskills App")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
}
|
|
|
|
// Important à ajouter
|
|
.environmentObject(user)
|
|
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|
|
|