<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macOS: 15.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WindowLayoutRoot/sizeThatFits(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16WindowLayoutRootV12sizeThatFitsySo6CGSizeVAA16ProposedViewSizeVF"
  },
  "title" : "sizeThatFits(_:)"
}
-->

# sizeThatFits(_:)

Asks the window’s content for its size.

```
func sizeThatFits(_ proposal: ProposedViewSize) -> CGSize
```

## Parameters

`proposal`

A proposed size for the subview. In SwiftUI,
views choose their own size, but can take a size proposal from
their parent view into account when doing so.

## Return Value

The size that the content chooses for itself, given the
proposal from its container view.

---

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)