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

# window(_:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:)

Tells the delegate the window will resize for presentation during version browsing.

```
@MainActor optional func window(_ window: NSWindow, willResizeForVersionBrowserWithMaxPreferredSize maxPreferredFrameSize: NSSize, maxAllowedSize maxAllowedFrameSize: NSSize) -> NSSize
```

## Parameters

`window`

The window being presented in a version browser.

`maxPreferredFrameSize`

The maximum size the version browser would prefer the window to be.

`maxAllowedFrameSize`

The maximum allowed size for the window (the full-screen frame minus the margins required to ensure the Versions controls are still visible).

## Return Value

The size that the window should be.

## Discussion

Windows entering the version browser will be resized to the size returned by this method. If either dimension of the returned size is larger than the `maxPreferredFrameSize`, the window will also be scaled down to ensure it fits properly in the version browser.

If this method is not implemented, the version browser will use [`windowWillUseStandardFrame(_:defaultFrame:)`](/documentation/AppKit/NSWindowDelegate/windowWillUseStandardFrame(_:defaultFrame:)) to determine the resulting window frame size.

---

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)