<!--
{
  "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(_:at:anchor:)-5dgmd",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15GraphicsContextV4draw_2at6anchoryAA4TextV_So7CGPointVAA9UnitPointVtF"
  },
  "title" : "draw(_:at:anchor:)"
}
-->

# draw(_:at:anchor:)

Draws text into the context, aligning an anchor within the ideal size
of the rendered text to a point in the context.

```
func draw(_ text: Text, at point: CGPoint, anchor: UnitPoint = .center)
```

## Parameters

`text`

The `Text` view to draw. Before drawing, the method converts
the view to `ResolvedText` by calling `resolve(_:)-4dx65`.

`point`

A point within the rectangle of the resolved text to anchor
to a point in the context.

`anchor`

A `UnitPoint` within the context to align the text with.
The default is `UnitPoint/center`.

## Discussion

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

---

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)