Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 524 Bytes

2020-05-18_how-to-make-a-view-dismiss-itself.md

File metadata and controls

19 lines (13 loc) · 524 Bytes
title createdAt
How to make a view dismiss itself
2020-05-18 06:44:39 UTC

How to make a view dismiss itself

.sheet(isPresented: $showingNewUserView) {
    NewUserView(isPresented: self.$showingNewUserView)
}

Using this approach, SwiftUI will cause those two views to read and write the same Boolean value, which means when NewUserView sets the Boolean back to false it will hide the sheet automatically.


https://www.hackingwithswift.com/quick-start/swiftui/how-to-make-a-view-dismiss-itself