Contents

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 animation is nil, the view doesn’t animate.

Return Value

A view that applies animation to this view whenever it changes.

See Also

Adding state-based animation to a view