// // ContentView.swift // NavigationExemple // // Created by Arthur Dambrine on 02/04/2021. // import SwiftUI struct ResultView: View { var choice: String var body: some View { Text("You chose \(choice)") } } struct ContentView: View { var body: some View { NavigationView{ VStack(alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/, spacing: 20){ NavigationLink( destination: ResultView(choice: "Heads")){ Text("Chosing Heads") .padding() } NavigationLink( destination: ResultView(choice: "Tails")){ Text("Chosing Tails") .padding() } }.navigationTitle("Menu principal") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }