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

# maxSize

The maximum size to which the window’s frame (including its title bar) can be sized.

```
var maxSize: NSSize { get set }
```

## Discussion

The maximum size constraint is enforced for resizing by the user as well as for the `setFrame...` methods other than [`setFrame(_:display:)`](/documentation/AppKit/NSWindow/setFrame(_:display:)) and [`setFrame(_:display:animate:)`](/documentation/AppKit/NSWindow/setFrame(_:display:animate:)). Note that the window server limits window sizes to 10,000.

The default maximum size of a window is `{FLT_MAX, FLT_MAX}` (`FLT_MAX` is defined in `/usr/include/float.h`). When the maximum size of a window has been set, there is no way to reset it other than by specifying this default maximum size.

The [`contentMaxSize`](/documentation/AppKit/NSWindow/contentMaxSize) property takes precedence over this property.

---

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)