---
title: "draw(in:frame:from:darkUserInterfaceStyle:)"
framework: pencilkit
role: symbol
role_heading: Instance Method
path: "pencilkit/pkdrawing-swift.struct/draw(in:frame:from:darkuserinterfacestyle:)"
---

# draw(in:frame:from:darkUserInterfaceStyle:)

Draws the drawing in the specified rectangle.

## Declaration

```swift
nonisolated(nonsending) func draw(in cgContext: CGContext, frame: CGRect, from sourceRect: CGRect, darkUserInterfaceStyle: Bool = false) async
```

## Parameters

- `frame`: The rectangle (in the coordinate system of the graphics context) in which to draw the drawing.
- `sourceRect`: The rectangle (in the drawing coordinate system) from which to draw.
- `darkUserInterfaceStyle`: Use a dark user interface style for rendering.
