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

# highlight(_:withFrame:in:)

Redraws the receiver with the specified highlight setting.

```
func highlight(_ flag: Bool, withFrame cellFrame: NSRect, in controlView: NSView)
```

## Parameters

`flag`

If <doc://com.apple.documentation/documentation/Swift/true>, the cell is redrawn with a highlight; otherwise, if <doc://com.apple.documentation/documentation/Swift/false>, the highlight is removed.

`cellFrame`

The bounding rectangle of the receiver.

`controlView`

The control that manages the cell.

## Discussion

Note that the `NSCell` highlighting does not appear when highlighted cells are printed (although instances of `NSTextFieldCell`, `NSButtonCell`, and others can print themselves highlighted). Generally, you cannot depend on highlighting being printed because implementations of this method may choose (or not choose) to use transparency.

---

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)