Contents

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.

Declaration

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 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.