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

# drawingRect(forBounds:)

Returns the rectangle within which the receiver draws itself

```
func drawingRect(forBounds rect: NSRect) -> NSRect
```

## Parameters

`rect`

The bounding rectangle of the receiver.

## Return Value

The rectangle in which the receiver draws itself. This rectangle is slightly inset from the one in `theRect`.

## See Also

[`func calcSize()`](/documentation/AppKit/NSControl/calcSize())

Recomputes any internal sizing information for the receiver, if necessary.



---

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)