Instance Method インスタンスメソッド

draw(_:in:)

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

Declaration 宣言

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

Parameters パラメータ

text

The GraphicsContext.ResolvedText to draw. Get resolved text from a Text view by calling resolve(_:). Alternatively, you can call draw(_:in:) with a Text view, and that method performs the resolution automatically.

rect

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

shading

The shading to use when coloring the text.

Discussion 議論

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

See Also 参照

Drawing Text