<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISpringTimingParameters/init(mass:stiffness:damping:initialVelocity:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISpringTimingParameters(im)initWithMass:stiffness:damping:initialVelocity:"
  },
  "title" : "init(mass:stiffness:damping:initialVelocity:)"
}
-->

# init(mass:stiffness:damping:initialVelocity:)

Creates a timing parameters object with the specified spring stiffness, mass, damping coefficient, and initial velocity.

```
init(mass: CGFloat, stiffness: CGFloat, damping: CGFloat, initialVelocity velocity: CGVector)
```

## Parameters

`mass`

The effective mass of the animated property. This value must be greater than `0`.

`stiffness`

The spring stiffness coefficient. Higher values correspond to a stiffer spring that yields a greater amount of force for moving objects.

`damping`

The damping force to apply to the spring’s motion. This value is used to compute the damping ratio.

`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 `dx` and `dy` components of `0`.

    For details about how to calculate this velocity, see [`initialVelocity`](/documentation/UIKit/UISpringTimingParameters/initialVelocity)    .

## Return Value

An initialized spring timing parameters object or `nil` if the object could not be created.

## Discussion

The damping ratio for the spring is computed from the formula `damping` / (2 * sqrt (`stiffness` * `mass`)).

---

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)