Protocol

CAMediaTiming

The CAMediaTiming protocol models a hierarchical timing system, with each object describing the mapping of time values from the object's parent to local time.

Overview

Absolute time is defined as mach time converted to seconds. The CACurrentMediaTime() function is provided as a convenience for getting the current absolute time.

The conversion from parent time to local time has two stages:

  1. Conversion to “active local time”. This includes the point at which the object appears in the parent object's timeline and how fast it plays relative to the parent.

  2. Conversion from “active local time” to “basic local time”. The timing model allows for objects to repeat their basic duration multiple times and, optionally, to play backwards before repeating.

Symbols

Animation Start Time

var beginTime: CFTimeInterval
Required.

Specifies the begin time of the receiver in relation to its parent object, if applicable.

var timeOffset: CFTimeInterval
Required.

Specifies an additional time offset in active local time.

Repeating Animations

var repeatCount: Float
Required.

Determines the number of times the animation will repeat.

var repeatDuration: CFTimeInterval
Required.

Determines how many seconds the animation will repeat for.

Duration and Speed

var duration: CFTimeInterval
Required.

Specifies the basic duration of the animation, in seconds.

var speed: Float
Required.

Specifies how time is mapped to receiver’s time space from the parent time space.

Playback Modes

var autoreverses: Bool
Required.

Determines if the receiver plays in the reverse upon completion.

var fillMode: String
Required.

Determines if the receiver’s presentation is frozen or removed once its active duration has completed.

Constants

Fill Modes

These constants determine how the timed object behaves once its active duration has completed. They are used with the fillMode property.

Relationships