---
title: contentAspectRatio
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nswindow/contentaspectratio
---

# contentAspectRatio

The window’s content aspect ratio.

## Declaration

```swift
var contentAspectRatio: NSSize { get set }
```

## Discussion

Discussion By default, the content aspect ratio (that is, height in relation to width) is (0, 0). If you set the aspect ratio of a window’s content view, the dimensions of its content rectangle are constrained to integral multiples of that ratio when users resize it. You can set a window’s content view to any size programmatically, regardless of its aspect ratio. The value of this property takes precedence over aspectRatio.

## See Also

### Sizing Content

- [contentMinSize](appkit/nswindow/contentminsize.md)
- [setContentSize(_:)](appkit/nswindow/setcontentsize(_:).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)
