Using SwiftUI, I've built a NavigationView that takes the user to another NavigationView, and finally, to a simple View. When I get to the last view, I can see two back buttons and a very large Navigation Bar.
I'd like to have a navigation structure similar to the iOS Settings app, where one navigation list takes to another and each of them have one back button that goes back to the previous screen.
Does anyone know how to solve this?
Best Answer
You should only have one
NavigationView
in your view hierarchy, as an ancestor of the menu view. You can then useNavigationLink
s at any level of the hierarchy under that.So, for example, your root view could be defined like this:
Then your menu view has
NavigationLink
s to the appropriate views:Your appointment list view also contains
NavigationLink
s to the appointment detail views:Result: