---
title: "draw(_:in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/graphicscontext/draw(_:in:)-69ad8"
---

# draw(_:in:)

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

## Declaration

```swift
func draw(_ text: GraphicsContext.ResolvedText, in rect: CGRect)
```

## Parameters

- `text`: The doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/ResolvedText to draw. Get resolved text from a doc://com.apple.SwiftUI/documentation/SwiftUI/Text view by calling doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/resolve(_:)-4dx65. Alternatively, you can call doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/draw(_:in:)-5opqf with a doc://com.apple.SwiftUI/documentation/SwiftUI/Text view, and that method performs the resolution automatically.
- `rect`: The rectangle in the current user space to draw the text in.

## Discussion

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