---
title: "setFrameUsingName(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/setframeusingname(_:)"
---

# setFrameUsingName(_:)

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

## Declaration

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

## Parameters

- `name`: The name of the frame to read.

## Return Value

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

## Discussion

Discussion The frame is constrained according to the window’s minimum and maximum size settings. This method causes a windowWillResize(_:to:) message to be sent to the delegate.

## See Also

### Managing Window Frames in User Defaults

- [removeFrame(usingName:)](appkit/nswindow/removeframe(usingname:).md)
- [setFrameUsingName(_:force:)](appkit/nswindow/setframeusingname(_:force:).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)
