---
title: "setFrameUsingName(_:force:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/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.

## Declaration

```swift
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 doc://com.apple.appkit/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

Return Value true when name is read and the frame is set successfully; otherwise, false.

## See Also

### Managing Window Frames in User Defaults

- [removeFrame(usingName:)](appkit/nswindow/removeframe(usingname:).md)
- [setFrameUsingName(_:)](appkit/nswindow/setframeusingname(_:).md)
- [saveFrame(usingName:)](appkit/nswindow/saveframe(usingname:).md)
- [setFrameAutosaveName(_:)](appkit/nswindow/setframeautosavename(_:).md)
- [frameAutosaveName](appkit/nswindow/frameautosavename-swift.property.md)
- [NSWindow.FrameAutosaveName](appkit/nswindow/frameautosavename-swift.typealias.md)
- [frameDescriptor](appkit/nswindow/framedescriptor.md)
- [setFrame(from:)](appkit/nswindow/setframe(from:).md)
- [NSWindow.PersistableFrameDescriptor](appkit/nswindow/persistableframedescriptor.md)
