Okay, so by adding a .navigationDestination(for:) to the sidebar column, it fixes the content to detail column animation.

However, now the sidebar to content column animation is broken. I've tried fiddling around with .navigationBarTitleDisplayMode(.large), etc. Nada.

I need to lay down.

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 😅

@phill You can build your own NavigationView with pure SwiftUI. It works *way* better.

A lot of the bugs in SwiftUI come from buggy wrappers around UIKit. This is why it’s better on WatchOS and even worse on the Mac.

Pure SwiftUI, when not using views that wrap complex UIKit views tend to work much better and be less buggy.

It’s a lot of work, but you’ll get many benefits too. E.g. MatchedGeometryEffecf across pages which doesn’t work with NavigationView/Stack

@phill Now, recreating the UI perfectly for NavigationStack won’t be super easy, but it’s possible to get pretty close.

You need an Array of views and you need to render the last two views at all times.

The edge-swipe means putting a thin invisible view over the whole screen and use drag gestures etc.

I’m doing something similar in a side project, but I’m not even trying to duplicate the UI 1:1.

Follow

@nmn it’s certainly possible, but you end up in that “uncanny valley” of UI where it’s close, but it’s not quite right. Also I can’t think of a way around using erasure/AnyView, which has its own set of drawbacks.

@phill “Uncanny Valley” is a fair concern which is why we decided to deviate further from the “default” look.

RE: Erasure/AnyView, works well in this use-case IMO. Since the Screen/Route View is the one getting erased, it doesn’t matter since whenever you change the route you want a fresh render anyway.

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.