article

Friday, May 7, 2021

SwiftUI How to let users pick options from a menu

SwiftUI How to let users pick options from a menu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
//  ContentView.swift
//  Testapp
//
//  Created by Cairocoders
//
 
import SwiftUI
 
struct SecondView: View {
    var body: some View{
        Text("This is a second view details")
    }
}
struct ContentView: View {
    var body: some View {
        NavigationView{
            VStack {
                NavigationLink(destination: SecondView()) {
                   Text("Show Details View")
                }
                .navigationTitle("Navigation")
            }
        }
    }
}
 
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Related Post