<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIGraphicsPopContext()",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@F@UIGraphicsPopContext"
  },
  "title" : "UIGraphicsPopContext()"
}
-->

# UIGraphicsPopContext()

Removes the current graphics context from the top of the stack, restoring the previous context.

```
func UIGraphicsPopContext()
```

## Discussion

Use this function to balance calls to the [`UIGraphicsPushContext(_:)`](/documentation/UIKit/UIGraphicsPushContext(_:)) function.

This function may be called from any thread of your app.

---

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)