---
title: "layerWillDraw(_:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/calayerdelegate/layerwilldraw(_:)"
---

# layerWillDraw(_:)

Notifies the delegate of an imminent draw.

## Declaration

```swift
optional func layerWillDraw(_ layer: CALayer)
```

## Parameters

- `layer`: The layer whose contents will be drawn.

## Discussion

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. important: This method is not called if the delegate implements display(_:).

## See Also

### Providing the Layer’s Content

- [display(_:)](quartzcore/calayerdelegate/display(_:).md)
- [draw(_:in:)](quartzcore/calayerdelegate/draw(_:in:).md)
