Contents

velocity(value:time:context:)

Calculates the velocity of the animation at a specified time.

Declaration

nonisolated func velocity<V>(value: V, time: TimeInterval, context: AnimationContext<V>) -> V? where V : VectorArithmetic

Parameters

  • value:

    The vector to animate towards.

  • time:

    The amount of time since the start of the animation.

  • context:

    An instance of Animationcontext that provides access to state and the animation environment.

Return Value

The current velocity of the animation, or nil if the animation has finished.

Discussion

Implement this method to provide the velocity of the animation at a given time. Should subsequent animations merge with the animation, the system preserves continuity of the velocity between animations.

The default implementation of this method returns nil.