<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/preferredContentSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(py)preferredContentSize"
  },
  "title" : "preferredContentSize"
}
-->

# preferredContentSize

The desired size of the view controller’s view, in screen units.

```
var preferredContentSize: NSSize { get set }
```

## Discussion

Set this property to express the desired size for a view controller’s view. A parent view controller can consult the value of this property when performing layout.

## See Also

[`preferredMaximumSize`](/documentation/AppKit/NSViewController/preferredMaximumSize)

For a view controller that is part of an app extension, the largest allowable size for the app extension’s primary view, in screen units.

[`preferredMinimumSize`](/documentation/AppKit/NSViewController/preferredMinimumSize)

For a view controller that is part of an app extension, the smallest allowable size for the app extension’s primary view, in screen units.

[`preferredScreenOrigin`](/documentation/AppKit/NSViewController/preferredScreenOrigin)

For a view controller that is part of an app extension, the preferred screen origin.



---

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)