Methods your app can implement to respond to layer-related events.


@protocol CALayerDelegate


You can implement the methods of this protocol to provide the layer’s content, handle the layout of sublayers, and provide custom animation actions to perform. The object that implements this protocol must be assigned to the delegate property of the layer object.


Providing the Layer's Content

- displayLayer:

Tells the delegate to implement the display process.

- drawLayer:inContext:

Tells the delegate to implement the display process using the layer's CGContextRef.

- layerWillDraw:

Notifies the delegate of an imminent draw.

Laying Out Sublayers

- layoutSublayersOfLayer:

Tells the delegate a layer's bounds have changed.

Providing a Layer's Actions

- actionForLayer:forKey:

Returns the default action of the actionForKey: method.


Inherits From

Conforming Types

See Also

Layer Basics


An object that manages image-based content and allows you to perform animations on that content.


A representation of a single layout constraint between two layers.


Methods that allow an object to manage the layout of a layer and its sublayers.


An object that provides a constraint-based layout manager.


An interface that allows objects to respond to actions triggered by a CALayer change.

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