<!--
{
  "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/UIViewPropertyAnimator/init(duration:timingParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewPropertyAnimator(im)initWithDuration:timingParameters:"
  },
  "title" : "init(duration:timingParameters:)"
}
-->

# init(duration:timingParameters:)

Initializes the animator object with a custom timing curve object.

```
init(duration: TimeInterval, timingParameters parameters: any UITimingCurveProvider)
```

## Parameters

`duration`

The duration of the animation, in seconds.

`parameters`

The object providing the timing information. This object must adopt the [`UITimingCurveProvider`](/documentation/UIKit/UITimingCurveProvider) protocol.

## Return Value

An initialized animator object or `nil` if the object could not be created.

## Discussion

Use this method to initialize the animator with a custom timing curve. After initializing the animator, you must add one or more animation blocks before calling starting the animations.

The animator object returned by this method begins in the [`UIViewAnimatingState.inactive`](/documentation/UIKit/UIViewAnimatingState/inactive) state. You must explicitly start the animations by calling the [`startAnimation()`](/documentation/UIKit/UIViewAnimating/startAnimation()) method.

---

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)