animation(_:)
Applies the given animation to this view when this view changes.
Declaration
nonisolated func animation(_ animation: Animation?) -> some View
Parameters
- animation:
The animation to apply. If
animationisnil, the view doesn’t animate.
Return Value
A view that applies animation to this view whenever it changes.