Instance Method

stroke(_:)

Paints a rectangular path using the currently selected stroke color.

Declaration

func stroke(_ rect: CGRect)

Parameters

rect

A rectangle, specified in the Core Graphics coordinate space with values in points.

Discussion

Before calling this method, select the stroke color with the setStroke() method on an instance of UIColor.

For an example of how to use this method, see Creating an Image with an Image Renderer in UIGraphicsImageRenderer.

See Also

Drawing Content

func stroke(CGRect, blendMode: CGBlendMode)

Paints a rectangular path using the currently selected stroke color and specified blend mode.

func fill(CGRect, blendMode: CGBlendMode)

Paints a rectangular area with the currently selected fill color using the supplied blend mode.

func fill(CGRect)

Paints a rectangular area with the currently selected fill color.