Instance Method


Detaches the layer from its parent layer.


- (void)removeFromSuperlayer;


You can use this method to remove a layer (and all of its sublayers) from a layer hierarchy. This method updates both the superlayer’s list of sublayers and sets this layer’s superlayer property to nil.

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.

- insertSublayer:atIndex:

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

- 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