Instance Method

layerWillDraw(_:)

Notifies the delegate of an imminent draw.

Declaration

optional func layerWillDraw(_ layer: CALayer)

Parameters

layer

The layer whose contents will be drawn.

Discussion

The layerWillDraw(_:) method is called before draw(_:in:). You can use this method to configure any layer state affecting contents prior to draw(_:in:) such as contentsFormat and isOpaque.

See Also

Providing the Layer's Content

func display(CALayer)

Tells the delegate to implement the display process.

func draw(CALayer, in: CGContext)

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