---
title: "runDrawingActions(_:completionActions:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigraphicsrenderer/rundrawingactions(_:completionactions:)"
---

# runDrawingActions(_:completionActions:)

Performs drawing actions on a Core Graphics context that the renderer prepares.

## Declaration

```swift
func runDrawingActions(_ drawingActions: (UIGraphicsRendererContext) -> Void, completionActions: ((UIGraphicsRendererContext) -> Void)? = nil) throws
```

## Parameters

- `drawingActions`: A doc://com.apple.uikit/documentation/UIKit/UIGraphicsDrawingActions block that represents a set of drawing instructions that the renderer applies to the Core Graphics context.
- `completionActions`: A doc://com.apple.uikit/documentation/UIKit/UIGraphicsDrawingActions block that the renderer calls after executing the drawingActions block.

## Discussion

Discussion This method invokes the drawingActions block in a Core Graphics context. This context was created by the context(with:) method, captured in an instance of the class returned by the rendererContextClass() method, and prepared by the prepare(_:with:) 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

- [UIGraphicsDrawingActions](uikit/uigraphicsdrawingactions.md)
