---
title: CASpringAnimation
framework: quartzcore
role: symbol
role_heading: Class
path: quartzcore/caspringanimation
---

# CASpringAnimation

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

## Declaration

```swift
class CASpringAnimation
```

## Overview

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 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, the animated layer may exceed its frame. let springAnimation = CASpringAnimation(keyPath: "transform.scale")

springAnimation.fromValue = 0 springAnimation.toValue = 1

## Topics

### Configuring Physical Attributes

- [damping](quartzcore/caspringanimation/damping.md)
- [initialVelocity](quartzcore/caspringanimation/initialvelocity.md)
- [mass](quartzcore/caspringanimation/mass.md)
- [settlingDuration](quartzcore/caspringanimation/settlingduration.md)
- [stiffness](quartzcore/caspringanimation/stiffness.md)

### Initializers

- [init(perceptualDuration:bounce:)](quartzcore/caspringanimation/init(perceptualduration:bounce:).md)

### Instance Properties

- [allowsOverdamping](quartzcore/caspringanimation/allowsoverdamping.md)
- [bounce](quartzcore/caspringanimation/bounce.md)
- [perceptualDuration](quartzcore/caspringanimation/perceptualduration.md)

## Relationships

### Inherits From

- [CABasicAnimation](quartzcore/cabasicanimation.md)

### Conforms To

- [CAAction](quartzcore/caaction.md)
- [CAMediaTiming](quartzcore/camediatiming.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Animation

- [CAAnimation](quartzcore/caanimation.md)
- [CAAnimationDelegate](quartzcore/caanimationdelegate.md)
- [CAPropertyAnimation](quartzcore/capropertyanimation.md)
- [CABasicAnimation](quartzcore/cabasicanimation.md)
- [CAKeyframeAnimation](quartzcore/cakeyframeanimation.md)
- [CATransition](quartzcore/catransition.md)
- [CAValueFunction](quartzcore/cavaluefunction.md)
