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

# windowWillUseStandardFrame(_:defaultFrame:)

Called by `NSWindow`’s [`zoom(_:)`](/documentation/AppKit/NSWindow/zoom(_:)) method while determining the frame a window may be zoomed to.

```
@MainActor optional func windowWillUseStandardFrame(_ window: NSWindow, defaultFrame newFrame: NSRect) -> NSRect
```

## Parameters

`window`

The window whose frame size is being determined.

`newFrame`

The size of the current screen, which is the screen containing the largest part of the window’s current frame, possibly reduced on the top, bottom, left, or right, depending on the current interface style. The frame is reduced on the top to leave room for the menu bar.

## Return Value

The specified window’s standard frame.

## Discussion

The standard frame for a window should supply the size and location that are “best” for the type of information shown in the window, taking into account the available display or displays. For example, the best width for a window that displays a word-processing document is the width of a page or the width of the display, whichever is smaller. The best height can be determined similarly. On return from this method, the [`zoom(_:)`](/documentation/AppKit/NSWindow/zoom(_:)) method modifies the returned standard frame, if necessary, to fit on the current screen.

---

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)