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

# setFrameUsingName(_:)

Sets the window’s frame rectangle by reading the rectangle data stored under a given name from the defaults system.

```
func setFrameUsingName(_ name: NSWindow.FrameAutosaveName) -> Bool
```

## Parameters

`name`

The name of the frame to read.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> when `name` is read and the frame is set successfully; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The frame is constrained according to the window’s minimum and maximum size settings. This method causes a [`windowWillResize(_:to:)`](/documentation/AppKit/NSWindowDelegate/windowWillResize(_:to:)) message to be sent to the delegate.

---

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)