An animation that applies a spring-like force to a layer's properties.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Core Animation
You would typically use a spring animation to animate a layer's position so that it appears to be pulled towards a target by a spring. The further the layer is from the target, the greater the acceleration towards it is.
CASpring allows control over physically based attributes such as the spring's damping and stiffness.
You can use a spring animation to animation properties of a layer other than its position. Listing 1 shows how to create a spring animation that bounces a layer into view by animating its scale from
1. Because the spring animation can overshoot its
to, the animated layer may exceed its frame.