Instance Method


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


- (void)insertSublayer:(CALayer *)layer atIndex:(unsigned int)idx;



The sublayer to be inserted into the current layer.


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


An array containing the layer’s sublayers.


The superlayer of the layer.

- addSublayer:

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

- removeFromSuperlayer

Detaches the layer from its parent layer.

- insertSublayer:below:

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

- insertSublayer:above:

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

- replaceSublayer:with:

Replaces the specified sublayer with a different layer object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software