<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKDrawing-swift.struct/draw(in:frame:from:darkUserInterfaceStyle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit9PKDrawingV4draw2in5frame4from22darkUserInterfaceStyleySo12CGContextRefa_So6CGRectVALSbtYaF"
  },
  "title" : "draw(in:frame:from:darkUserInterfaceStyle:)"
}
-->

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

Draws the drawing in the specified rectangle.

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)