<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/highlightSelection(inClipRect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)highlightSelectionInClipRect:"
  },
  "title" : "highlightSelection(inClipRect:)"
}
-->

# highlightSelection(inClipRect:)

Highlights the region of the table view in the specified rectangle.

```
func highlightSelection(inClipRect clipRect: NSRect)
```

## Parameters

`clipRect`

The rectangle, in the table view view’s coordinate system.

## Discussion

This method is invoked before [`drawRow(_:clipRect:)`](/documentation/AppKit/NSTableView/drawRow(_:clipRect:)).

[`NSCell`](/documentation/AppKit/NSCell)-based table views can override this method to change the manner in which they highlight selections.

> Note:
> This method should not be subclassed or overridden for a view-base table view. Instead, row drawing customization should be done by subclassing ``doc://com.apple.appkit/documentation/AppKit/NSTableRowView``.

---

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)