---
title: "highlight(_:withFrame:in:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscell/highlight(_:withframe:in:)"
---

# highlight(_:withFrame:in:)

Redraws the receiver with the specified highlight setting.

## Declaration

```swift
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

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.

## See Also

### Drawing and Highlighting

- [draw(withFrame:in:)](appkit/nscell/draw(withframe:in:).md)
- [highlightColor(withFrame:in:)](appkit/nscell/highlightcolor(withframe:in:).md)
- [drawInterior(withFrame:in:)](appkit/nscell/drawinterior(withframe:in:).md)
- [controlView](appkit/nscell/controlview.md)
- [isHighlighted](appkit/nscell/ishighlighted.md)
