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

# drawBackground(in:)

Draws the background of the row in the rectangle.

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

## Parameters

`dirtyRect`

The rectangle that requires drawing.

## Discussion

Overriding this method allows an application to draw a custom background for a table row view.

By default, this method draws the background color or group row style as appropriate for the row. This method also draws the “below look” for a drop target if [`isTargetForDropOperation`](/documentation/AppKit/NSTableRowView/isTargetForDropOperation) is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)