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 }
  • id

    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

    snapshot

    The layer snapshot for which to return the animations.

    propertyID

    The ID of the property to return the animations for.

    Return Value

    The sequence of animations associated to layers property property.

  • Returns the animations for all the properties of the specifed layer.

    Declaration

    func animationsForLayer(_ snapshot: LayerSnapshot) -> Array

    Parameters

    snapshot

    The 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

    snapshot

    The 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

    snapshot

    The layer snapshot to return the keyframes for.

    simulateStepsWithKeyvalues

    true 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

    time

    The 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

    snapshot

    The layer snapshot for which to fetch the composite path.

    time

    The time at which to fetch the composite path.

    Return Value

    The composite of the layer snashot at time time, or nil if the layer is not a layer of type shape.

  • Returns the list of tracks associated to the specified layer in the timeline.

    Declaration

    func tracksForLayer(_ layer: Layer) -> Array

    Parameters

    layer

    The 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

    snapshot

    The layer snapshot for which to return the track.

    propertyID

    The 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

    snapshot

    The snapshot to return the tracks for.

    layerType

    A 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

    snapshot

    The 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

    propertyID

    The id of the property whose value to return.

    layer

    The layer whose property value to return.

    time

    The 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 of snapshot.

    Declaration

    func pathTrack(layer snapshot: LayerSnapshot) -> Track?

    Parameters

    snapshot

    The snapshot for which to return the track.

    Return Value

    The track for the combinedPath property of snapshot. This method will return nil if the path of snapshot is not animated.

  • Returns a track containing the size animation of snapshot.

    Declaration

    func sizeTrack(layer snapshot: LayerSnapshot) -> Track?

    Parameters

    snapshot

    The snapshot for which to return the track.

    Return Value

    The track for the size property of snapshot. This method will return nil if the size of snapshot 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

    lhs

    A value.

    rhs

    Another value.

    Return Value

    true if the lhs and rhs are equal, false otherwise.