<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCell/draw(withFrame:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCell(im)drawWithFrame:inView:"
  },
  "title" : "draw(withFrame:in:)"
}
-->

# draw(withFrame:in:)

Draws the receiver’s border and then draws the interior of the cell.

```
func draw(withFrame cellFrame: NSRect, in controlView: NSView)
```

## Parameters

`cellFrame`

The bounding rectangle of the receiver.

`controlView`

The control that manages the cell.

## Discussion

This method draws the cell in the currently focused view, which can be different from the `controlView` passed in. Taking advantage of this behavior is not recommended, however.

---

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)