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

# frameRect(forContentRect:)

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

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

## Parameters

`contentRect`

The content rectangle for the window expressed in screen coordinates.

## Return Value

The window’s frame rectangle, expressed in screen coordinates, with `contentRect`.

## Discussion

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