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

# drawSelection(in:)

Draws the selected row.

```
func drawSelection(in dirtyRect: NSRect)
```

## Parameters

`dirtyRect`

The rectangle that requires drawing.

## Discussion

This method is only called if the selection should be drawn.

The selection will automatically be alpha-blended if the selection is animating in or out.

The default selection drawn is dependent on the [`selectionHighlightStyle`](/documentation/AppKit/NSTableView/selectionHighlightStyle-swift.property).

---

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)