<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/UIHostingControllerSizingOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI32UIHostingControllerSizingOptionsV"
  },
  "title" : "UIHostingControllerSizingOptions"
}
-->

# UIHostingControllerSizingOptions

Options for how a hosting controller tracks its content’s size.

```
struct UIHostingControllerSizingOptions
```

## Topics

### Getting sizing options

[`static let intrinsicContentSize: UIHostingControllerSizingOptions`](/documentation/SwiftUI/UIHostingControllerSizingOptions/intrinsicContentSize)

The hosting controller’s view automatically invalidate its intrinsic
content size when its ideal size changes.

[`static let preferredContentSize: UIHostingControllerSizingOptions`](/documentation/SwiftUI/UIHostingControllerSizingOptions/preferredContentSize)

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

### Creating a sizing option

[`init(rawValue: Int)`](/documentation/SwiftUI/UIHostingControllerSizingOptions/init(rawValue:))

Creates a new option set from a raw value.

[`let rawValue: Int`](/documentation/SwiftUI/UIHostingControllerSizingOptions/rawValue)

The raw value.

## Relationships

### Conforms To

[`OptionSet`](/documentation/Swift/OptionSet)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)