---
title: "frame(withWidth:using:)"
framework: corefoundation
role: symbol
role_heading: Instance Method
path: "corefoundation/cgrect/frame(withwidth:using:)"
---

# frame(withWidth:using:)

Draws a frame around the inside of this rect in the current NSGraphicsContext in the context’s fill color The compositing operation of the fill defaults to the context’s compositing operation, not necessarily using .copy like NSFrameRect().

## Declaration

```swift
func frame(withWidth width: CGFloat = 1.0, using operation: NSCompositingOperation = NSGraphicsContext.current?.compositingOperation ?? .sourceOver)
```

## Discussion

Discussion note: There must be a set current NSGraphicsContext.
