---
title: endPage()
framework: coregraphics
role: symbol
role_heading: Instance Method
path: coregraphics/cgcontext/endpage()
---

# endPage()

Ends the current page in a page-based graphics context.

## Declaration

```swift
func endPage()
```

## Discussion

Discussion When using a graphics context that supports multiple pages, you should call this function to terminate drawing in the current page.

## See Also

### Managing a Page-Based Graphics Context

- [beginPage(mediaBox:)](coregraphics/cgcontext/beginpage(mediabox:).md)
