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

# contentRect(forFrameRect:)

Returns the window’s content rectangle with a given frame rectangle.

```
func contentRect(forFrameRect frameRect: NSRect) -> NSRect
```

## Parameters

`frameRect`

The frame rectangle for the window expressed in screen coordinates.

## Return Value

The window’s content rectangle, expressed in screen coordinates, with f`rameRect`.

## Discussion

The window uses its current style mask in computing the content rectangle. See [`NSWindow.StyleMask`](/documentation/AppKit/NSWindow/StyleMask-swift.struct) for a list of style mask values. The main advantage of this instance-method counterpart to [`contentRect(forFrameRect:styleMask:)`](/documentation/AppKit/NSWindow/contentRect(forFrameRect:styleMask:)) is that it allows you to take toolbars into account when converting between content and frame rectangles. (The toolbar is not included in the content rectangle.)

---

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)