<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIGraphicsRenderer/runDrawingActions(_:completionActions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIGraphicsRenderer(im)runDrawingActions:completionActions:error:"
  },
  "title" : "runDrawingActions(_:completionActions:)"
}
-->

# runDrawingActions(_:completionActions:)

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

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

## Parameters

`drawingActions`

A [`UIGraphicsDrawingActions`](/documentation/UIKit/UIGraphicsDrawingActions) block that represents a set of drawing instructions that the renderer applies to the Core Graphics context.

`completionActions`

A [`UIGraphicsDrawingActions`](/documentation/UIKit/UIGraphicsDrawingActions) block that the renderer calls after executing the `drawingActions` block.

## Discussion

This method invokes the `drawingActions` block in a Core Graphics context. This context was created by the [`context(with:)`](/documentation/UIKit/UIGraphicsRenderer/context(with:)) method, captured in an instance of the class returned by the [`rendererContextClass()`](/documentation/UIKit/UIGraphicsRenderer/rendererContextClass()) method, and prepared by the [`prepare(_:with:)`](/documentation/UIKit/UIGraphicsRenderer/prepare(_:with:)) method.

Do not override this method. Instead, consider invoking it from a utility method in your subclass, as the [`UIGraphicsImageRenderer`](/documentation/UIKit/UIGraphicsImageRenderer) and [`UIGraphicsPDFRenderer`](/documentation/UIKit/UIGraphicsPDFRenderer) classes do.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)