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

# drawKeyEquivalent(withFrame:in:)

Draws the key equivalent associated with the menu item.

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

## Parameters

`cellFrame`

A rectangle defining the receiver’s frame area.

`controlView`

The view object that contains this cell (usually an [`NSControl`](/documentation/AppKit/NSControl) object).

## Discussion

This method invokes [`keyEquivalentRect(forBounds:)`](/documentation/AppKit/NSMenuItemCell/keyEquivalentRect(forBounds:)), passing it `cellFrame`, to calculate the rectangle in which to draw the key equivalent. This method is invoked by the cell’s `drawWithFrame:` method. You should not need to invoke it directly. Subclasses may override this method to control the drawing of the key equivalent.

---

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)