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

# setFrameUsingName(_:force:)

Sets the window’s frame rectangle by reading the rectangle data stored under a given name from the defaults system. Can operate on non-resizable windows.

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

## Parameters

`name`

The name of the frame to read.

`force`

<doc://com.apple.documentation/documentation/Swift/true> to use [`setFrameUsingName(_:)`](/documentation/AppKit/NSWindow/setFrameUsingName(_:)) on a non-resizable window; <doc://com.apple.documentation/documentation/Swift/false> to fail on a non-resizable window.

## 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>.

---

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)