I was trying to do a simple navigation between two views programmatically using NavigationLink, but I'd like the navigation transition to fade as opposed to sliding in from the right. I do this with these modifiers around the NavigationView:
NavigationView {
// welcome screen UI code
}
.navigationViewStyle(.stack)
.navigationTransition(.fade(.out).animation(.easeInOut(duration: 0.9)))
For some reason, after the navigation occurs, the pulsing animation jumps. Here's a 5 second video showing the jump.
Forgive my extremely crappy code (this is just a prototype), but here's the code of the SwiftUI view that animates the dot using scaleEffect
.
Any ideas why this is happening? Is there some better way to start the animation so it doesn't lag?
The strange thing is that when I transition from the start screen to the dot screen without a navigation, there is no jump. Why does it only jump when I navigate?
if appViewModel.state == .newUser {
StartScreenView(appViewModel: appViewModel).transition(.opacity.animation(.easeInOut(duration: 1.0)))
else {
RecordingView().transition(.opacity.animation(.easeInOut(duration: 1.0)))
}