---
title: "windowShouldZoom(_:toFrame:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindowdelegate/windowshouldzoom(_:toframe:)"
---

# windowShouldZoom(_:toFrame:)

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

## Declaration

```swift
@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

Return Value true to allow window’s frame to become newFrame; otherwise, false.

## See Also

### Zooming Window

- [windowWillUseStandardFrame(_:defaultFrame:)](appkit/nswindowdelegate/windowwillusestandardframe(_:defaultframe:).md)
