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

    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, text and shapeMask layers.

    Declaration

    var type: LayerType { get }
  • The layer’s name.

    Declaration

    var name: String { get }
  • true if the layer was visible on the stage, false otherwise.

    Declaration

    var visible: Bool { get }
  • Determines the editable state of the layer. true if the layer is uneditable and false if 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 equals function is invoked using infix notation as in the following code snippet: lhs == rhs.

    Declaration

    func equals(_ lhs: Layer) -> Bool

    Parameters

    lhs

    A value.

    rhs

    Another value.

    Return Value

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