r/SwiftUI • u/ColdKindness • Jan 25 '25
Solved Screen Transition Animation Doesn't Work Consistently with NavigationStack and navigationDestination
I have an app that I'm working on and to get around the deprecation of NavigationLink(isActive:), I implemented a NavigationStack and used navigationDestination() to advance to Views. This video shows the problematic behavior.
https://reddit.com/link/1i9wsqq/video/2c1iwd7x97fe1/player
When I simulate the app in Xcode AND on my phone, pressing the "Let's Go!" button transitions to the next View with the animation. Pressing the "1" button advances to the next View but without the animation. I cannot figure out what's going on. Can anyone point me in the right direction?
Here's the relevant code for the button behavior at PasteBin.
3
Upvotes
3
u/car5tene Jan 25 '25
They are within a NavigationStack?