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 to0to 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
dxanddycomponents of0.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.