Timeline
class Timeline
A Timeline contains a scene, along with a set of tracks which express how the scene’s layer hierarchy is animated over time.
-
A flattened list of all the animations that belong to the timeline.
Declaration
var animations: Array { get }
-
A list of all animation groups that belong to the timeline.
Declaration
var animationsByTiming: Array { get }
-
The total duration of the timeline.
Declaration
var duration: Double { get }
-
The list of the fonts used in this timeline.
Declaration
var fonts: Array { get }
-
The timeline’s unique identifier.
Declaration
var id: String { get }
-
The list of images used in this timeline.
Declaration
var images: Array { get }
-
A configuration object which represents the state of the scene a time 0.
Declaration
var initialConfiguration: ExplicitConfiguration { get }
-
The a snapshot of the scene’s root layer at time 0.
Declaration
var initialRootLayer: LayerSnapshot { get }
-
The timeline’s name.
Declaration
var name: String { get }
-
The timeline’s scene.
Declaration
var scene: Scene { get }
-
The list of sounds used in this timeline.
Declaration
var sounds: Array { get }
-
The list of soundTracks that belong to this timeline.
Declaration
var soundTracks: Array { get }
-
The minimum time between keyvalues in this timeline.
Declaration
var timeResolution: Double { get }
-
The list of track’s which dictate how the scene’s layer hierarchy is animated over time.
Declaration
var tracks: Array { get }
-
A dictionary which organizes tracks by layer and property.
Declaration
var tracksByLayerProperty: Dictionary { get }
-
A copy of the timeline that has been reversed.
Declaration
var reversed: Timeline { get }
-
The object’s description
Declaration
var description: String { get }
-
Returns the sequence of animations associated to the specified property of the given layer.
Declaration
func animationsFor(layer snapshot: LayerSnapshot, property propertyID: String) -> Array
Parameters
snapshotThe layer snapshot for which to return the animations.
propertyIDThe ID of the property to return the animations for.
Return Value
The sequence of animations associated to
layer
s propertyproperty
. -
Returns the animations for all the properties of the specifed layer.
Declaration
func animationsForLayer(_ snapshot: LayerSnapshot) -> Array
Parameters
snapshotThe layer snapshot for which to return the animations.
Return Value
The list of animations for all the properties of the specified layer.
-
Creates the list of animation groups for the given layer snapshot.
Declaration
func animationsByTimingForLayer(_ snapshot: LayerSnapshot) -> Array
Parameters
snapshotThe layer snapshot to create the animation groups for.
Return Value
The list of animations group for layer snapshot.
-
Returns the list of keyframes associated to the layer snapshot.
The list of keyframes contains at least 2 elements, one for time 0 and one for time
timeline.duration
even if no keyframes exist at those times.Declaration
func keyframesForLayer(_ snapshot: LayerSnapshot, simulateStepsWithKeyvalues: Bool) -> Array
Parameters
snapshotThe layer snapshot to return the keyframes for.
simulateStepsWithKeyvaluestrue
if steps should be simulated via the addition of keyvalues,false
otherwise.Return Value
A chonologically ordered sequence of keyframes associated to the layer snapshot.
-
Creates a snapshot of the timeline’s layer hierarchy at the specified time.
Declaration
func rootLayer(at time: Double) -> LayerSnapshot
Parameters
timeThe time to generate the snapshot for.
Return Value
The root of the snapshot of the timeline’s layer hierarchy at time
time
. -
Fetches the composite path of the layer snaphot at the specified time.
Declaration
func path(layer snapshot: LayerSnapshot, at time: Double) -> CompositePath?
Parameters
snapshotThe layer snapshot for which to fetch the composite path.
timeThe time at which to fetch the composite path.
Return Value
The composite of the layer snashot at time
time
, ornil
if the layer is not a layer of typeshape
. -
Returns the list of tracks associated to the specified layer in the timeline.
Declaration
func tracksForLayer(_ layer: Layer) -> Array
Parameters
layerThe layer to return the track’s for.
Return Value
The list of tracks to associated to
layer
in the timeline. -
Returns the track for the specified layer and property.
Declaration
func trackFor(layer snapshot: LayerSnapshot, property propertyID: String) -> Track?
Parameters
snapshotThe layer snapshot for which to return the track.
propertyIDThe property id of the track to search for.
Return Value
The track for the specified layer snapshot and property, or
nil
if such a track does not exist. -
Returns the list of tracks associated to specified layer which are specific to the given layer type.
Declaration
func tracksFor(layer snapshot: LayerSnapshot, ofType layerType: String) -> Array
Parameters
snapshotThe snapshot to return the tracks for.
layerTypeA string representing the layer type.
Return Value
The list of tracks associated to
snapshot
specific to the given layer type. -
Returns the list of non path shape tracks associated to the specified snapshot.
Declaration
func nonPathShapeTracksFor(layer snapshot: LayerSnapshot) -> Array
Parameters
snapshotThe snapshot to return the non path shape tracks for.
Return Value
The list of non path shape tracks associated to the specified snapshot.
-
Returns the value of a specified layer and property at the specified time.
Declaration
func value(property propertyID: String, layer: Layer, time: Double) -> Any
Parameters
propertyIDThe id of the property whose value to return.
layerThe layer whose property value to return.
timeThe time for which to return property value of the layer.
Return Value
The value of the specified layer and property at the specified time.
-
Returns the track containing the
combinedPath
animation ofsnapshot
.Declaration
func pathTrack(layer snapshot: LayerSnapshot) -> Track?
Parameters
snapshotThe snapshot for which to return the track.
Return Value
The track for the
combinedPath
property ofsnapshot
. This method will returnnil
if the path ofsnapshot
is not animated. -
Returns a track containing the
size
animation ofsnapshot
.Declaration
func sizeTrack(layer snapshot: LayerSnapshot) -> Track?
Parameters
snapshotThe snapshot for which to return the track.
Return Value
The track for the
size
property ofsnapshot
. This method will returnnil
if the size ofsnapshot
is not animated. -
Compares two values for equality.
The
equals
function is invoked using infix notation as in the following code snippet:lhs == rhs
.Declaration
func equals(_ lhs: Timeline) -> Bool
Parameters
lhsA value.
rhsAnother value.
Return Value
true
if thelhs
andrhs
are equal,false
otherwise.