I refuse to sleep until I have found a solution to this, which is unfortunate, as it means I may never sleep again 🥲
I've now officially arrived in crazy town, and started wrapping UINavigationController myself.
What's interesting is that the SwiftUI environment is still automatically adding nav items to the controller, so I've actually got the same broken animations as with NavigationStack. At least it’s…consistent.
Running out of ideas now 😅
Hallelujah! 🙌
Finally got a workaround for the NavigationSplitView regression in iOS 16.4.
Transitions stop working when the content column no longer contains a List (say you have a “Select Mailbox" view, a Grid, etc).
Here's a gist of the issue: https://gist.github.com/phillipcaudell/6d4d0efac6a22cd42bf75f3acd7a033b
It seems to suddenly start behaving like a NavigationStack, which is why adding a navigationDestination sorta works (except now you've got wonky nav animations, and it still sometimes fails)…
If there's any poor souls stumbling across this in the future, here's a gist to my solution: https://gist.github.com/phillipcaudell/085580a9412284f381a4730930c7d52f
Now to refactor this back into Big Mail 🥲 #SwiftUI
Anyways I'm back to use NavigationLinks(value:) again, which this time seems to be behaving.
I think the reason it wasn't working last time is because I had installed a navigationDestination on my Sidebar (which is shared between compact and regular size class). It looks like it was confusing NavigationSplitView.
Now I have the navigationDestination installed just in the compact size class, and things seem okay…
And here's the rub with SwiftUI: I'm sure there are certain things I'm still doing “the wrong way”, despite doing this everyday, and reading all the docs and examples I can.
But because there have been so many genuine issues (as seen by others), my default position is “Well, the API must be broken then”. That's not a helpful mindset when debugging.
@phill The API is genuinely broken a lot of the times. Specially the whole navigation stack is hopelessly broken, it better after iOS 16 but not enough.
@phill Ha, yeah that's the """fun""" in SwiftUI ...!
Thanks for sharing this. This is pretty involved!
My personal notes about edge cases, corner cases, and undocumented ("flip"?) cases are growing alarmingly.
I don't even have that many "this is not what you'd expect" observation logs for TextKit!
@ctietze I'm all funned out 🫠
@phill When can we expect a TestFlight build? Would be great to get the possibility to join.
@HOsy very soon 😊
Okay, another update on my Navigation Saga, because sharing is caring.
After integrating, I noticed selected rows wouldn't unselect when popping back.
Turns out using .tags() will only work if:
1) The root List is bound directly to an ObservedObject. A Binding to the same value in an ObservableObject won't work.
2) The List must only contain Text or Label views (so no pinned Grid at the top).
I'm also not sure why the Binding gets fired so many times VS the ObservedObject either? #SwiftUI