Instance Method

runDrawingActions:completionActions:error:

Performs drawing actions on a Core Graphics context prepared by the renderer.

Declaration

- (BOOL)runDrawingActions:(UIGraphicsDrawingActions)drawingActions completionActions:(UIGraphicsDrawingActions)completionActions error:(NSError * _Nullable *)error;

Parameters

drawingActions

A UIGraphicsDrawingActions block that represents a set of drawing instructions that the renderer applies to the Core Graphics context.

completionActions

A UIGraphicsDrawingActions block that the renderer calls after executing the drawingActions block.

error

A pointer to an NSError object that is populated if there is a problem performing the drawing actions.

Return Value

YES if the drawing is performed successfully, NO otherwise.

Discussion

This method invokes the drawingActions block in a Core Graphics context. This context was created by the contextWithFormat: method, captured in an instance of the class returned by the rendererContextClass method, and prepared by the prepareCGContext:withRendererContext: method.

Do not override this method. Instead, consider invoking it from a utility method in your subclass, as the UIGraphicsImageRenderer and UIGraphicsPDFRenderer classes do.

See Also

Running the Drawing Actions