---
title: clip()
framework: corefoundation
role: symbol
role_heading: Instance Method
path: corefoundation/cgrect/clip()
---

# clip()

Modifies the current graphics context clipping path by intersecting it with this rect. This permanently modifies the graphics state, so the current state should be saved beforehand and restored afterwards.

## Declaration

```swift
func clip()
```

## Discussion

Discussion note: There must be a set current NSGraphicsContext.
