I stumbled onto a workaround which might be usefull for someone else. I also have the observable Router class with a published NavigationPath, passed along as environment object as described here. I agree that it looks like a bug in iOS 18, the same code works in iOS 17 and also by just removing the tab view. The workaround is to pass the path as a manually created binding:
NavigationStack(path: Binding(get: { navigationPath }, set: { navigationPath = $0 })) {
...
}
Maybe this stops SwiftUI from applying some optimization which is buggy?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: