Document

class Document

An object representing a flow document.

  • The name of the document.

    Declaration

    var name: String { get }
  • All the timelines in the exported document.

    Declaration

    var timelines: Array { get }
  • The object’s description

    Declaration

    var description: String { get }
  • Collects all the images used throughout the given timeline.

    This list includes the images displayed by image layers and the fill images displayed by shape layers which belong to timeline.

    Declaration

    func images(forTimeline timeline: Timeline) -> Array

    Parameters

    timeline

    The timeline whose images are gathered.

    Return Value

    A list containing all the images used throughout timeline.

  • Collects all the fonts used throughout the given timeline.

    This list includes the fonts displayed by text layers belonging to timeline.

    Declaration

    func fonts(forTimeline timeline: Timeline) -> Array

    Parameters

    timeline

    The timeline whose fonts are gathered.

    Return Value

    A list containing all the fonts used throughout timeline.

  • Collects all the sounds used throughout the given timeline.

    This list includes the sounds belonging to timelines soundtracks.

    Declaration

    func sounds(forTimeline timeline: Timeline) -> Array

    Parameters

    timeline

    The timeline whose sounds are gathered.

    Return Value

    A list containing all the sounds played throughout the timeline.

  • Searches for a timeline with the given prefix.

    Declaration

    func getTimelineWith(prefix: String) -> Timeline

    Parameters

    prefix

    the prefix.

    Return Value

    A timeline in the document whose name begins with the given prefix.