NavigationView and NavigationLink with Variable Bindings
Comments (2)
jsayer7
3 years ago
To build on the last part, Apple encourages that @State variables be marked private to reinforce that these properties are meant to be used for their local view.
Brian Voong
3 years ago
jsayer7
3 years ago
Correct. https://developer.apple.com/documentation/swiftui/state explains more. While I'm enjoying SwiftUI, there are many things that just show it isn't quite ready for primetime for more complex applications.
Jerem
3 years ago
Hi Brian,
Instead of adding the binding variable of isShowing to the SelectLocationView you can just use the @Environment(\.presentationMode) as you would with .sheet.
Works the same, and no need to pass in another Binding.