Duplicate back buttons

Hello just got started with Swift UI and loving it but the back buttons with my navigation links are staying when progressing any ideas? 

I guess you are nested NavigationViews.

It's great to hear that you're enjoying using SwiftUI!

The behavior that's showing in the attached screenshot may happen if the app is navigating to a view that contains another NavigationView. To resolve this issue, you'll want to start at the code for your app's main NavigationView (Titled "SF Park Guide" here) and see where the NavigationLink in the view is pointed to. That second view should not contain another NavigationView in SwiftUI.

Below is some sample code that demonstrates how this might look:

struct ContentView: View {

    var listItems: [String] = [

        "Apple",

        "Orange",

        "Pear"

    ]

    

    var body: some View {

        NavigationView {

            List(listItems, id: \.hash) { item in

                NavigationLink(destination: DetailView(detailItem: item)) {

                    Text(item)

                }

            }

            .navigationTitle("Primary View")

        }

    }

}



struct DetailView: View {

    var detailItem: String

    

    var body: some View {

        Text(detailItem)

            .padding()

            .navigationTitle("Detail View")

    }

}
Duplicate back buttons
 
 
Q