A function that defines the pacing of an animation as a timing curve.


class CAMediaTimingFunction : NSObject


CAMediaTimingFunction represents one segment of a function that defines the pacing of an animation as a timing curve. The function maps an input time normalized to the range [0,1] to an output time also in the range [0,1].

You can create a media timing function by supplying your own cubic Bézier curve control points using the init(controlPoints:_:_:_:) method or by using one of the predefined timing functions.


Creating Timing Functions

init(name: CAMediaTimingFunctionName)

Creates and returns a new instance of CAMediaTimingFunction configured with the predefined timing function specified by name.

init(controlPoints: Float, Float, Float, Float)

Returns an initialized timing function modeled as a cubic Bézier curve using the specified control points.

Accessing the Control Points

func getControlPoint(at: Int, values: UnsafeMutablePointer<Float>)

Returns the control point for the specified index.


Predefined Timing Functions

Constants that specify system-provided timing functions, used by init(name:).


Inherits From

See Also

Animation Timing

func CACurrentMediaTime() -> CFTimeInterval

Returns the current absolute time, in seconds.

protocol CAMediaTiming

Methods that model a hierarchical timing system, allowing objects to map time between their parent and local time.

class CADisplayLink

A timer object that allows your application to synchronize its drawing to the refresh rate of the display.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software