I my swiftui navigation stack i want to remove the back button from the view but i want to allow the user to move to the previous screen when it is pinched from the left hand side
@main
struct MyApp: App {
@State private var path = [String]()
var body: some Scene {
WindowGroup {
NavigationStack(path: $path){
FirstView(path: $path)
}.navigationDestination(for: String.self) { string in
SecondView()
}
}
}
}
Now in my SecondView i have added .navigationBarHidden(true)
which removes the back button but also removes the ability to pinch back to the previous view