In this hands-on challenge, practice everything you have learned about navigation and state in a SwiftUI app.
This is a companion discussion topic for the original entry at https://www.kodeco.com/37678937-swiftui-fundamentals/lessons/14
In this hands-on challenge, practice everything you have learned about navigation and state in a SwiftUI app.
When using a swiftUI sheet, a bool is used. When set to 'true, the view is shown. Does this bool need to be set back to โfalseโ when the view is changed, by tapping the โbackโ button for instance?
Hi! Thatโs a great question. Most of the time, when the view is dismissed - either with a swipe down of the sheet or through use of the .dismiss() environment property, that boolean is automatically toggled for you, since that bool is usually defined as a state/binding pair. Let us know if you have any other questions!