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

# drawFocusRingMask(withFrame:in:)

Draws the focus ring for the control.

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

## Parameters

`cellFrame`

The bounding rectangle of the receiver, or a portion of the bounding rectangle.

`controlView`

The view that manages the cell.

## Discussion

Implemented by NSCell subclasses to draw the appropriate focus ring for the control The default implementation does nothing.

The Application Kit automatically invokes this method when appropriate, to render the view’s focus ring. The view must be eligible to become its window’s [`firstResponder`](/documentation/AppKit/NSWindow/firstResponder), by overriding [`acceptsFirstResponder`](/documentation/AppKit/NSResponder/acceptsFirstResponder) returning <doc://com.apple.documentation/documentation/Swift/true>.

The focus ring is rendered using the style specified by the [`focusRingType`](/documentation/AppKit/NSCell/focusRingType) property, which must not be [`NSFocusRingType.none`](/documentation/AppKit/NSFocusRingType/none) unless you want to suppress drawing of the focus ring. An implementation of `drawFocusRingMaskWithFrame:inView:` can assume that it is drawing in the view’s bounds, and that the fill and stroke colors have been set to an arbitrary fully opaque color. It needs only draw the desired focus ring shape or an image or other object whose outline defines the focus ring mask.

This new OS X v10.7 focus ring API should no longer call [`set()`](/documentation/AppKit/NSFocusRingPlacement/set())() and perform it’s own drawing.

---

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)