<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GraphicsContext/draw(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15GraphicsContextV4draw_2inyAC14ResolvedSymbolV_So6CGRectVtF::OverloadGroup"
  },
  "title" : "draw(_:in:)"
}
-->

# draw(_:in:)

Draws a resolved symbol into the context, using the specified rectangle
as a layout frame.

```
func draw(_ symbol: GraphicsContext.ResolvedSymbol, in rect: CGRect)
```

## Parameters

`symbol`

The [`GraphicsContext.ResolvedSymbol`](/documentation/SwiftUI/GraphicsContext/ResolvedSymbol) to draw. Get a resolved symbol
by calling [`resolveSymbol(id:)`](/documentation/SwiftUI/GraphicsContext/resolveSymbol(id:)) with the identifier that you
use to tag the corresponding child view during [`Canvas`](/documentation/SwiftUI/Canvas)
initialization.

`rect`

The rectangle in the current user space to draw the symbol in.

## Discussion

The current context state defines the full drawing operation. For
example, the current transformation and clip shapes affect how SwiftUI
draws the symbol.

---

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)