Contents

interpolatingSpring(mass:stiffness:damping:initialVelocity:)

An interpolating spring animation that uses a damped spring model to produce values in the range [0, 1] that are then used to interpolate within the [from, to] range of the animated property. Preserves velocity across overlapping animations by adding the effects of each animation.

Declaration

static func interpolatingSpring(mass: Double = 1.0, stiffness: Double, damping: Double, initialVelocity: Double = 0.0) -> Animation

Parameters

  • mass:

    The mass of the object attached to the spring.

  • stiffness:

    The stiffness of the spring.

  • damping:

    The spring damping value.

  • initialVelocity:

    The initial velocity of the spring, as a value in the range [0, 1] representing the magnitude of the value being animated.

Return Value

A spring animation.

See Also

Customizing spring animations