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

# ProposedViewSize

A proposal for the size of a view.

```
@frozen struct ProposedViewSize
```

## Overview

During layout in SwiftUI, views choose their own size, but they do that
in response to a size proposal from their parent view. When you create
a custom layout using the [`Layout`](/documentation/SwiftUI/Layout) protocol, your layout container
participates in this process using `ProposedViewSize` instances.
The layout protocol’s methods take a proposed size input that you
can take into account when arranging views and calculating the size of
the composite container. Similarly, your layout proposes a size to each
of its own subviews when it measures and places them.

Layout containers typically measure their subviews by proposing several
sizes and looking at the responses. The container can use this information
to decide how to allocate space among its subviews. A
layout might try the following special proposals:

- The [`zero`](/documentation/SwiftUI/ProposedViewSize/zero) proposal; the view responds with its minimum size.
- The [`infinity`](/documentation/SwiftUI/ProposedViewSize/infinity) proposal; the view responds with its maximum size.
- The [`unspecified`](/documentation/SwiftUI/ProposedViewSize/unspecified) proposal; the view responds with its ideal size.

A layout might also try special cases for one dimension at a time. For
example, an [`HStack`](/documentation/SwiftUI/HStack) might measure the flexibility of its subviews’
widths, while using a fixed value for the height.

## Topics

### Getting standard proposals

[`zero`](/documentation/SwiftUI/ProposedViewSize/zero)

A size proposal that contains zero in both dimensions.

[`infinity`](/documentation/SwiftUI/ProposedViewSize/infinity)

A size proposal that contains infinity in both dimensions.

[`unspecified`](/documentation/SwiftUI/ProposedViewSize/unspecified)

The proposed size with both dimensions left unspecified.

### Creating a custom size proposal

[`init(_:)`](/documentation/SwiftUI/ProposedViewSize/init(_:))

Creates a new proposed size from a specified size.

[`init(width:height:)`](/documentation/SwiftUI/ProposedViewSize/init(width:height:))

Creates a new proposed size using the specified width and height.

### Getting the proposal’s dimensions

[`height`](/documentation/SwiftUI/ProposedViewSize/height)

The proposed vertical size measured in points.

[`width`](/documentation/SwiftUI/ProposedViewSize/width)

The proposed horizontal size measured in points.

### Modifying a proposal

[`replacingUnspecifiedDimensions(by:)`](/documentation/SwiftUI/ProposedViewSize/replacingUnspecifiedDimensions(by:))

Creates a new proposal that replaces unspecified dimensions in this
proposal with the corresponding dimension of the specified size.



---

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)