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

# setContentSize(_:)

Sets the size of the window’s content view to a given size, which is expressed in the window’s base coordinate system.

```
func setContentSize(_ size: NSSize)
```

## Parameters

`size`

The new size of the window’s content view in the window’s base coordinate system.

## Discussion

This size in turn alters the size of the `NSWindow` object itself. Note that the window server limits window sizes to 10,000; if necessary, be sure to limit `aSize` relative to the frame rectangle.

## See Also

[`-  setFrame:display:`](/documentation/AppKit/NSWindow/setFrame(_:display:))

Sets the origin and size of the window’s frame rectangle according to a given frame rectangle, thereby setting its position and size onscreen.

[`+  frameRectForContentRect:styleMask:`](/documentation/AppKit/NSWindow/frameRect(forContentRect:styleMask:))

Returns the frame rectangle used by a window with a given content rectangle and window style.

[`+  contentRectForFrameRect:styleMask:`](/documentation/AppKit/NSWindow/contentRect(forFrameRect:styleMask:))

Returns the content rectangle used by a window with a given frame rectangle and window style.



---

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)