In iOS13/SwiftUI 1 you could have code like this inside a NavigationView without the frame moving.
This would animate the color from blue to red when the view appeared as expected. But in iOS 14/SwiftUI 2 this is no longer the case, when the view appears the entire thing animates in from the top right like some sort of 90s slideshow transition.
If the view is not a child of a NavigationView this problem disappears.
Is this an intended change or a bug? The only workaround I've found so far is using .animation(.default, value: ..) and while that works well for the contrived example above it is very limiting when working with more complex views.
Code Block swift struct MyView: View { @State var color: Color = .blue var body: some View { Text("Hello, World!") .background(color) .animation(.default) .onAppear { color = .red } } }
This would animate the color from blue to red when the view appeared as expected. But in iOS 14/SwiftUI 2 this is no longer the case, when the view appears the entire thing animates in from the top right like some sort of 90s slideshow transition.
If the view is not a child of a NavigationView this problem disappears.
Is this an intended change or a bug? The only workaround I've found so far is using .animation(.default, value: ..) and while that works well for the contrived example above it is very limiting when working with more complex views.