Layer
class Layer
An object used to represent a visual element in a timeline. Layers are assembled hierarchically to form a “Layer Hierarchy”.
-
The list of the layer’s descendants, ordered by depth (low to high).
Declaration
var descendants: Array { get } -
The layer’s unique identifier.
Declaration
var id: String { get } -
The layer’s type. There are 5 different types of layers:
group,image,path,shape,textandshapeMasklayers.Declaration
var type: LayerType { get } -
The layer’s name.
Declaration
var name: String { get } -
trueif the layer was visible on the stage,falseotherwise.Declaration
var visible: Bool { get } -
Determines the editable state of the layer.
trueif the layer is uneditable andfalseif the layer is editable.Declaration
var locked: Bool { get } -
A string representation of the layer’s resizing constraint. A layer’s resizing constraint determines how the layer resizes itself in relation to it’s parent.
Declaration
var resizingConstraint: Double { get } -
The layer’s parent layer. (e.g. its daddy, or mommy or non-gender-conforming layer that is directly responsible for the layer.)
Declaration
var parent: Layer? { get } -
An ordered list of the layer’s children.
Declaration
var sublayers: Array { get } -
An group of layers to which a mask is applied.
Declaration
var clippingMask: Layer? { get } -
The object’s description
Declaration
var description: String { get } -
Compares two values for equality.
The
equalsfunction is invoked using infix notation as in the following code snippet:lhs == rhs.Declaration
func equals(_ lhs: Layer) -> BoolParameters
lhsA value.
rhsAnother value.
Return Value
trueif thelhsandrhsare equal,falseotherwise.