Instance Method

insertSublayer(_:at:)

Inserts the specified layer into the receiver’s list of sublayers at the specified index.

Declaration

func insertSublayer(_ layer: CALayer, at idx: UInt32)

Parameters

aLayer

The sublayer to be inserted into the current layer.

index

The index at which to insert aLayer. This value must be a valid 0-based index into the sublayers array.

See Also

Managing the Layer Hierarchy

var sublayers: [CALayer]?

An array containing the layer’s sublayers.

var superlayer: CALayer?

The superlayer of the layer.

func addSublayer(CALayer)

Appends the layer to the layer’s list of sublayers.

func removeFromSuperlayer()

Detaches the layer from its parent layer.

func insertSublayer(CALayer, below: CALayer?)

Inserts the specified sublayer below a different sublayer that already belongs to the receiver.

func insertSublayer(CALayer, above: CALayer?)

Inserts the specified sublayer above a different sublayer that already belongs to the receiver.

func replaceSublayer(CALayer, with: CALayer)

Replaces the specified sublayer with a different layer object.