NavigationStack loses its navigation bar on iPad when returning from the background, making it impossible to go back or do anything. iOS 16 and 17.
FB13120953
https://gist.github.com/phillipcaudell/f6258c1fbac69a9fb2cd030fadd087de
@phill
You could launch iPhone-only first? I’d wager most people don’t have an iPad.
@shauny that's definitely an option! It's just iPad is frustratingly close to finished; these last little things are letting it down.
@phill
Do you have the same issue without checking the sizeClass?
I tried a few similar things with dynamicly changing navigation paths and ran into a few issues. My theory is NavigationStack does not like being changed or presented with a populated stack.
See https://github.com/simonnickel/FB13080609-SwiftUISplitViewNavigationStackAppearCrash
@simonnickel Yeh it's 100% caused by switching on the size class. The irony is I'm only doing so because of a separate issue with NavigationSplitView (https://mastodon.notsobig.co/@phill/110939609793823190).
Your problem looks similar though. I've had some mild success now by tying the lifetime of the State directly to the NavigationStack. Both get destroyed together (keeping the Stack happy). The State can then be restored through some other mechanism (like a Binding) https://gist.github.com/phillipcaudell/6201a448310bcc7830eea8be3b7bd24e
If you're wondering why Big Mail is taking so long