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

# windowShouldZoom(_:toFrame:)

Asks the delegate whether the specified window should zoom to the specified frame.

```
@MainActor optional func windowShouldZoom(_ window: NSWindow, toFrame newFrame: NSRect) -> Bool
```

## Parameters

`window`

The window being zoomed.

`newFrame`

The rectangle to which the specified window is being zoomed.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to allow `window`’s frame to become `newFrame`; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

---

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)