Instance Method

insertSublayer(_:above:)

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

Declaration

func insertSublayer(_ layer: CALayer, above sibling: CALayer?)

Parameters

aLayer

The sublayer to be inserted into the current layer.

sublayer

An existing sublayer in the current layer. The layer in aLayer is inserted after this layer in the sublayers array, and thus appears in front of it visually.

Discussion

If sublayer is not in the receiver’s sublayers array, this method raises an exception.