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.
39 lines
925 B
39 lines
925 B
//
|
|
// ContentView.swift
|
|
// NavigationExemple
|
|
//
|
|
// Created by Arthur Dambrine on 02/04/2021.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
|
|
struct ContentView: View {
|
|
@State private var isShowingDetailView = false
|
|
|
|
var body: some View {
|
|
NavigationView{
|
|
|
|
VStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/, spacing: 20){
|
|
|
|
NavigationLink(destination: Text("Heads"), isActive: $isShowingDetailView){
|
|
EmptyView()
|
|
}
|
|
|
|
Button("Tap to show view"){
|
|
// Some custom code here
|
|
// ..
|
|
self.isShowingDetailView = true
|
|
}
|
|
|
|
}.navigationTitle("Menu principal")
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|
|
|