---
title: preferredContentSize
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/uihostingcontrollersizingoptions/preferredcontentsize
---

# preferredContentSize

The hosting controller tracks its content’s ideal size in its preferred content size.

## Declaration

```swift
static let preferredContentSize: UIHostingControllerSizingOptions
```

## Discussion

Discussion Use this option when using a hosting controller with a container view controller that requires up-to-date knowledge of the hosting controller’s ideal size. note: This option comes with a performance cost because it asks for the ideal size of the content using the unspecified size proposal.

## See Also

### Getting sizing options

- [intrinsicContentSize](swiftui/uihostingcontrollersizingoptions/intrinsiccontentsize.md)
