Contents

prepare(_:with:)

Applies the configuration specified in the renderer context to the Core Graphics context.

Declaration

class func prepare(_ context: CGContext, with rendererContext: UIGraphicsRendererContext)

Parameters

Discussion

The graphics renderer calls this method when the runDrawingActions(_:completionActions:) method is invoked. Override this method in a subclass to configure the underlying Core Graphics context before the renderer begins renderering.

Core Graphics contexts are reused for repeated calls to the runDrawingActions(_:completionActions:) method. Therefore, be sure to clean up the context to make it ready for reuse.

See Also

Managing graphics contexts