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

# setContentSize(_:)

Sets the size of the window’s content view to a given size, which is expressed in the window’s base coordinate system.

## Declaration

```swift
func setContentSize(_ size: NSSize)
```

## Parameters

- `size`: The new size of the window’s content view in the window’s base coordinate system.

## Discussion

Discussion This size in turn alters the size of the NSWindow object itself. Note that the window server limits window sizes to 10,000; if necessary, be sure to limit aSize relative to the frame rectangle.

## See Also

### Related Documentation

- [setFrame(_:display:)](appkit/nswindow/setframe(_:display:).md)
- [frameRect(forContentRect:styleMask:)](appkit/nswindow/framerect(forcontentrect:stylemask:).md)
- [contentRect(forFrameRect:styleMask:)](appkit/nswindow/contentrect(forframerect:stylemask:).md)

### Sizing Content

- [contentAspectRatio](appkit/nswindow/contentaspectratio.md)
- [contentMinSize](appkit/nswindow/contentminsize.md)
- [contentMaxSize](appkit/nswindow/contentmaxsize.md)
- [contentResizeIncrements](appkit/nswindow/contentresizeincrements.md)
- [contentLayoutGuide](appkit/nswindow/contentlayoutguide.md)
- [contentLayoutRect](appkit/nswindow/contentlayoutrect.md)
- [maxFullScreenContentSize](appkit/nswindow/maxfullscreencontentsize.md)
- [minFullScreenContentSize](appkit/nswindow/minfullscreencontentsize.md)
