Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 569 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 569 Bytes

Environment

Dismissing a view

import SwiftUI

struct ContentView: View {
    @Environment(\.presentationMode) var presentationMode
    
    var body: some View {
        Text("Hello")
            .onTapGesture {
                self.presentationMode.wrappedValue.dismiss()
            }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Links that help