Once @basememara mentioned that is may have something to do with the lazy loading I immediately thought about some (but not all) of my NavigationLinks using the following wrapper:
Swift
struct NavigationLazyViewContent: View: View {
let build: () - Content
init(_ build: @autoclosure @escaping () - Content) {
self.build = build
}
var body: Content {
build()
}
}
NavigationLink(destination: NavigationLazyView(DetailView())) { Text("Click me") }
Adopted from this source - https://stackoverflow.com/a/61234030/659389.
So I tried wrapping every destination with the aforementioned wrapped and it seems that the navigation stopped popping views off the stack back and forth. The Unable to present. Please file a bug. is still there, but navigation seems to be working fine. Will post an update it the popping horror comes back.
EDIT: It still pops back and forth, but I think not so often as before. To be honest I already don't know if it is my fault or apple's that this works like that. In SwiftUI sometimes things just start working differently without any iOS version updates or anything like that. Feels like a live lab.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: