---
title: "init(duration:timingParameters:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uiviewpropertyanimator/init(duration:timingparameters:)"
---

# init(duration:timingParameters:)

Initializes the animator object with a custom timing curve object.

## Declaration

```swift
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 doc://com.apple.uikit/documentation/UIKit/UITimingCurveProvider protocol.

## Return Value

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

## Discussion

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 state. You must explicitly start the animations by calling the startAnimation() method.

## See Also

### Initializing a property animator

- [init(duration:curve:animations:)](uikit/uiviewpropertyanimator/init(duration:curve:animations:).md)
- [init(duration:controlPoint1:controlPoint2:animations:)](uikit/uiviewpropertyanimator/init(duration:controlpoint1:controlpoint2:animations:).md)
- [init(duration:dampingRatio:animations:)](uikit/uiviewpropertyanimator/init(duration:dampingratio:animations:).md)
- [runningPropertyAnimator(withDuration:delay:options:animations:completion:)](uikit/uiviewpropertyanimator/runningpropertyanimator(withduration:delay:options:animations:completion:).md)
