Instance Method

initWithDuration:timingParameters:

Initializes the animator object with a custom timing curve object.

Declaration

- (instancetype)initWithDuration:(NSTimeInterval)duration timingParameters:(id<UITimingCurveProvider>)parameters;

Parameters

duration

The duration of the animation, in seconds.

parameters

The object providing the timing information. This object must adopt the 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 UIViewAnimatingStateInactive state. You must explicitly start the animations by calling the startAnimation method.

See Also

Initializing a Property Animator

- initWithDuration:curve:animations:

Initializes the animator with a built-in UIKit timing curve.

- initWithDuration:controlPoint1:controlPoint2:animations:

Initializes the animator object with a cubic Bézier timing curve.

- initWithDuration:dampingRatio:animations:

Initializes the animator object with spring-based timing information.

+ runningPropertyAnimatorWithDuration:delay:options:animations:completion:

Creates and returns an animator object that begins running its animations immediately.