SwiftUI Fundamentals, Episode 14: Challenge: Navigation & Bindings | Kodeco

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

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!