Generic Instance Method

animation(_:value:)

Applies the given animation to this view, whenever the specified value changes.

Declaration

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.

Return Value

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

See Also

Adding Animations to a View

func animation(Animation?) -> View

Applies the given animation to all animatable values within this view.

func transition(AnyTransition) -> View

Associates a transition with self.