Contents

init(dampingRatio:initialVelocity:)

Creates a timing parameters object with the specified damping ratio and initial velocity.

Declaration

init(dampingRatio ratio: CGFloat, initialVelocity velocity: CGVector)

Parameters

  • ratio:

    The damping ratio to apply to the spring’s motion. To smoothly decelerate the animation without oscillation, specify a value of 1. Specify values closer to 0 to create less damping and more oscillation.

  • velocity:

    The target property’s initial rate of change at the start of the spring animation. If the target property doesn’t change, specify a vector with dx and dy components of 0.

    For details about how to calculate this velocity, see Initialvelocity.

Return Value

An initialized spring timing parameters object or nil if the object could not be created.

See Also

Initializing a spring timing parameters object