Contents

draw(_:in:)

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

Declaration

func draw(_ text: Text, in rect: CGRect)

Parameters

  • text:

    The Text view to draw. Before drawing, the method converts the view to Resolvedtext by calling Resolve(_:) 4dx65.

  • rect:

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

Discussion

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