Class

UICubicTimingParameters

The timing information for animations in the form of a cubic Bézier curve.

Overview

Use a UICubicTimingParameters object to specify custom timing curves when creating animations with objects that adopt the UIViewAnimating protocol, such as UIViewPropertyAnimator.

A cubic Bézier timing curve consists of a line whose starting point is (0, 0), whose end point is (1, 1), and whose shape is defined by two control points. The slope of the line at each point in time defines the speed of the animation at that time. Steep slopes cause animations to appear to run faster and shallower slopes cause them to appear to run slower. Figure 1 shows a timing curve where the animations start fast and finish fast but run more slowly through the middle section.

Figure 1

A cubic Bézier timing curve

Topics

Initializing a Cubic Timing Parameters Object

init()

Initializes the object with the system’s default timing curve.

init(animationCurve: UIViewAnimationCurve)

Initializes the object with the specified UIKit timing curve.

init(controlPoint1: CGPoint, controlPoint2: CGPoint)

Initializes the object with the specified control points for a cubic Bézier curve.

Getting the Timing Parameters

var animationCurve: UIViewAnimationCurve

The standard UIKit animation curve to use for timing.

var controlPoint1: CGPoint

The first control point for the cubic Bézier curve.

var controlPoint2: CGPoint

The second control point of the cubic Bézier curve.

Relationships

Inherits From

See Also

Timing Curves

protocol UITimingCurveProvider

An interface for providing the timing information needed to perform animations.

class UISpringTimingParameters

The timing information for animations that mimics the behavior of a spring.