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 byshape
layers which belong totimeline
.Declaration
func images(forTimeline timeline: Timeline) -> Array
Parameters
timelineThe 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 totimeline
.Declaration
func fonts(forTimeline timeline: Timeline) -> Array
Parameters
timelineThe 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
timeline
s soundtracks.Declaration
func sounds(forTimeline timeline: Timeline) -> Array
Parameters
timelineThe timeline whose sounds are gathered.
Return Value
A list containing all the sounds played throughout the
timeline
. -
Collects all the glyphs used throughout the given timeline.
This list includes the glyphs displayed by
text
layers belonging totimeline
.Declaration
func glyphs(forTimeline timeline: Timeline) -> Dictionary
Parameters
timelineThe timeline whose glyphs are gathered.
Return Value
A dictionary containing all the glyphs used throughout
timeline
. The dictionaries keys constitute all the fonts used in the timeline. The dictionary’s values represent the list of characters which appear in the the timeline for each font. -
Searches for a timeline with the given prefix.
Declaration
func getTimelineWith(prefix: String) -> Timeline
Parameters
prefixthe prefix.
Return Value
A timeline in the document whose name begins with the given prefix.