<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NSHostingSizingOptions/preferredContentSize",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI22NSHostingSizingOptionsV20preferredContentSizeACvpZ"
  },
  "title" : "preferredContentSize"
}
-->

# preferredContentSize

The hosting controller creates and updates constraints that represent
its content’s ideal size. These constraints in turn influence the
hosting controller’s `preferredContentSize`.

```
static let preferredContentSize: NSHostingSizingOptions
```

## Discussion

The constraints reflect the size that fits a proposal of
`.unspecified`.

> Note: this option has no effect when used with an `NSHostingView`
> directly.

---

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)