To enable swipe back in a view with the navigation bar hidden, we set the navigationController's interactivePopGestureRecognizer delegate. When returning to the main screen by swiping back and then entering detailView again, the screen freezes. This phenomenon occurs only in iOS 17. It works normally in iOS16. I am curious as to why this phenomenon occurs in iOS 17 and how to resolve it.
this is the sample code that we used.
struct ContentView: View {
var body: some View {
NavigationStack {
NavigationLink(destination: DetailView()) {
Text("Go to Detail")
}
.navigationTitle("Main")
}
}
}
struct DetailView: View {
var body: some View {
Text("Detail View")
.toolbar(.hidden, for: .navigationBar)
}
}
extension UINavigationController: UIGestureRecognizerDelegate {
open override func viewDidLoad() {
super.viewDidLoad()
interactivePopGestureRecognizer?.delegate = self
}
}