Contents

animation(_:value:)

Applies the given animation to this view when the specified value changes.

Declaration

nonisolated func animation<V>(_ animation: Animation?, value: V) -> some View where V : Equatable

Parameters

  • animation:

    The animation to apply. If animation is nil, the view doesn’t animate.

  • value:

    A value to monitor for changes.

Mentioned in

Return Value

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

See Also

Adding state-based animation to a view