---
title: "draw(in:)"
framework: quartzcore
role: symbol
role_heading: Instance Method
path: "quartzcore/calayer/draw(in:)"
---

# draw(in:)

Draws the layer’s content using the specified graphics context.

## Declaration

```swift
func draw(in ctx: CGContext)
```

## Parameters

- `ctx`: The graphics context in which to draw the content. The context may be clipped to protect valid layer content. Subclasses that wish to find the actual region to draw can call doc://com.apple.documentation/documentation/CoreGraphics/CGContext/boundingBoxOfClipPath.

## Discussion

Discussion The default implementation of this method does not do any drawing itself. If the layer’s delegate implements the  draw(_:in:) method, that method is called to do the actual drawing. Subclasses can override this method and use it to draw the layer’s content. When drawing, all coordinates should be specified in points in the logical coordinate space.

## See Also

### Providing the layer’s content

- [contents](quartzcore/calayer/contents.md)
- [contentsRect](quartzcore/calayer/contentsrect.md)
- [contentsCenter](quartzcore/calayer/contentscenter.md)
- [display()](quartzcore/calayer/display().md)
