spring(duration:bounce:blendDuration:)
A persistent spring animation. When mixed with other spring() or interactiveSpring() animations on the same property, each animation will be replaced by their successor, preserving velocity from one animation to the next. Optionally blends the duration values between springs over a time period.
Declaration
static func spring(duration: TimeInterval = 0.5, bounce: Double = 0.0, blendDuration: Double = 0) -> AnimationParameters
- duration:
The perceptual duration, which defines the pace of the spring. This is approximately equal to the settling duration, but for very bouncy springs, will be the duration of the period of oscillation for the spring.
- bounce:
How bouncy the spring should be. A value of 0 indicates no bounces (a critically damped spring), positive values indicate increasing amounts of bounciness up to a maximum of 1.0 (corresponding to undamped oscillation), and negative values indicate overdamped springs with a minimum value of -1.0.
- blendDuration:
The duration in seconds over which to interpolate changes to the duration.
Return Value
A spring animation.
See Also
Customizing spring animations
springspring(_:blendDuration:)spring(response:dampingFraction:blendDuration:)interactiveSpringinteractiveSpring(response:dampingFraction:blendDuration:)interpolatingSpringinterpolatingSpring(_:initialVelocity:)interpolatingSpring(duration:bounce:initialVelocity:)interpolatingSpring(mass:stiffness:damping:initialVelocity:)