Instance Property

delegate

The layer’s delegate object.

Declaration

weak var delegate: CALayerDelegate? { get set }

Discussion

You can use a delegate object to provide the layer’s contents, handle the layout of any sublayers, and provide custom actions in response to layer-related changes. The object you assign to this property should implement one or more of the methods of the CALayerDelegate informal protocol. For more information about that protocol, see CALayerDelegate

In iOS, if the layer is associated with a UIView object, this property must be set to the view that owns the layer.