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
- context:
The Core Graphics context that the graphics renderer performs drawing actions on.
- rendererContext:
The renderer context object that is provided to the Rundrawingactions(_:completionactions:) method. This object is of the type returned by the Renderercontextclass() static method.
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.