Timeline

class Timeline

A container of many layers and keyframes that holds all the information for one animation from start to finish.

  • property documentation (update this)

    Declaration

    var animations: Array { get }
  • property documentation (update this)

    Declaration

    var animationsByTiming: Array { get }
  • property documentation (update this)

    Declaration

    var duration: Double { get }
  • property documentation (update this)

    Declaration

    var fonts: Array { get }
  • id

    property documentation (update this)

    Declaration

    var id: String { get }
  • property documentation (update this)

    Declaration

    var images: Array { get }
  • property documentation (update this)

    Declaration

    var initialConfiguration: ExplicitConfiguration { get }
  • property documentation (update this)

    Declaration

    var initialRootLayer: LayerSnapshot { get }
  • property documentation (update this)

    Declaration

    var name: String { get }
  • property documentation (update this)

    Declaration

    var scene: Scene { get }
  • property documentation (update this)

    Declaration

    var sounds: Array { get }
  • property documentation (update this)

    Declaration

    var soundTracks: Array { get }
  • property documentation (update this)

    Declaration

    var timeResolution: Double { get }
  • property documentation (update this)

    Declaration

    var tracks: Array { get }
  • property documentation (update this)

    Declaration

    var tracksByLayerProperty: Dictionary { get }
  • property documentation (update this)

    Declaration

    var reversed: Timeline { get }
  • The object’s description

    Declaration

    var description: String { get }
  • Returns the animations for a specific layer and property.

    Iterates through a list of tracks indexed by layer then property and collects all animations found in each track. If no animations are found the function returns an empty array.

    Declaration

    func animationsFor(layer snapshot: LayerSnapshot, property propertyID: String) -> Array

    Parameters

    snapshot

    Values of a specific layer at a specific time.

    propertyID

    ID of the property in question.

    Return Value

    An Array of animations for a specific layer and property.

  • Returns the animations for a specific layer.

    Iterates through a list of tracks and collects all the animations used in that track.

    Declaration

    func animationsForLayer(_ snapshot: LayerSnapshot) -> Array

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    Return Value

    Animations for a specific layer.

  • Returns a list of animations for a layer snapshot grouped by their timing.

    Uses a description of an animation start time, duration and timing function to group animations used in the same layer snapshot.

    Declaration

    func animationsByTimingForLayer(_ snapshot: LayerSnapshot) -> Array

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    Return Value

    An Array of animations for a layer snapshot grouped by their timing.

  • Returns a list of keyframes in a layer snapshot.

    Iterates thtough all the keyframes for a specific layer and gets all the keyvalues in the timeline sorted by time with steps simulated by keyvalues. Then adds empty keyframes at time 0 and time duration if no keyframes exist at those times.

    Declaration

    func keyframesForLayer(_ snapshot: LayerSnapshot, simulateStepsWithKeyvalues: Bool) -> Array

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    simulateStepsWithKeyvalues

    body

    Return Value

    Keyframes in a layer snapshot.

  • Returns a snapshot of the provided layer at a specific time.

    Determines the type of a specific layer and generates a snapshot of that layer at a specific time.

    Declaration

    func rootLayer(at time: Double) -> LayerSnapshot

    Parameters

    time

    The time to generate the snapshot at.

    Return Value

    A snapshot of the provided layer at a specific time.

  • Returns an amalgamation of all paths used in a layer snapshot.

    Iterates through an array of paths and combines every path instance into one instance of a composite path.

    Declaration

    func path(layer snapshot: LayerSnapshot, at time: Double) -> CompositePath?

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    time

    The time to return the list of paths at.

    Return Value

    An amalgamation of all paths used in a layer snapshot.

  • Returns a list of tracks to export for layer.

    Iterates through a list of tracks for a layer exports them if width height or path is animated for layer.

    Declaration

    func tracksForLayer(_ layer: Layer) -> Array

    Parameters

    layer

    The layer containing the tracks.

    Return Value

    A list of tracks to export for a layer.

  • Returns the track for a specific layer and property, or nil if the track doesn’t exist.

    Iterates through tracks indexed by layer then property and returns the track for each layer if it exists.

    Declaration

    func trackFor(layer snapshot: LayerSnapshot, property propertyID: String) -> Track?

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    propertyID

    The ID of the property in question.

    Return Value

    The track for a specific layer and property

  • Returns a list of tracks for a layer filtered by the layer type.

    Iterates through a list of tracks belonging to a single layer and filters the tracks based on the layers type.

    Declaration

    func tracksFor(layer snapshot: LayerSnapshot, ofType type: String) -> Array

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    type

    The type of the layer in question.

    Return Value

    A list of tracks for a layer filtered by the layer type.

  • Returns non path shape tracks for the given layer.

    Iterates through all tracks belonging to a specific layer and returns any tracks that contain non path shape tracks.

    Declaration

    func nonPathShapeTracksFor(layer snapshot: LayerSnapshot) -> Array

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    Return Value

    Non path shape tracks for the given layer.

  • Returns the value of a specific layers property at a specific time.

    Generates a Value object based on the property in questions value at a specific time of the animation.

    Declaration

    func value(property propertyName: String, layer: Layer, time: Double) -> Any

    Parameters

    propertyName

    The name of the property in question.

    layer

    The layer containing the property in question.

    time

    The time at which the value of the property will be determined.

    Return Value

    The value of a specific layers property at a specific time.

  • Returns a pathTrack for a specific layer if that layer is a ShapeLayer.

    Compute times at which to create keyvalues in path Track. Then returns the leading and trailing timing for the path keyvalue created from the keyframe.

    Declaration

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

    Parameters

    snapshot

    Values for a specific layer at a specific time.

    Return Value

    A pathTrack for a specific layer if that layer is a ShapeLayer.

  • 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.