<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CASpringAnimation",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CASpringAnimation"
  },
  "title" : "CASpringAnimation"
}
-->

# CASpringAnimation

An animation that applies a spring-like force to a layer’s properties.

```
class CASpringAnimation
```

## Overview

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.

[`CASpringAnimation`](/documentation/QuartzCore/CASpringAnimation) 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. The following code shows how to create a spring animation that bounces a layer into view by animating its scale from `0` to `1`. Because the spring animation can overshoot its [`toValue`](/documentation/QuartzCore/CABasicAnimation/toValue), the animated layer may exceed its frame.

```swift
let springAnimation = CASpringAnimation(keyPath: "transform.scale")

springAnimation.fromValue = 0
springAnimation.toValue = 1
```

## Topics

### Configuring Physical Attributes

[`damping`](/documentation/QuartzCore/CASpringAnimation/damping)

Defines how the spring’s motion should be damped due to the forces of friction.

[`initialVelocity`](/documentation/QuartzCore/CASpringAnimation/initialVelocity)

The initial velocity of the object attached to the spring.

[`mass`](/documentation/QuartzCore/CASpringAnimation/mass)

The mass of the object attached to the end of the spring.

[`settlingDuration`](/documentation/QuartzCore/CASpringAnimation/settlingDuration)

The estimated duration required for the spring system to be considered at rest.

[`stiffness`](/documentation/QuartzCore/CASpringAnimation/stiffness)

The spring stiffness coefficient.

### Initializers

[`init(perceptualDuration:bounce:)`](/documentation/QuartzCore/CASpringAnimation/init(perceptualDuration:bounce:))

### Instance Properties

[`allowsOverdamping`](/documentation/QuartzCore/CASpringAnimation/allowsOverdamping)

[`bounce`](/documentation/QuartzCore/CASpringAnimation/bounce)

[`perceptualDuration`](/documentation/QuartzCore/CASpringAnimation/perceptualDuration)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)