---
title: "sizeThatFits(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shape/sizethatfits(_:)"
---

# sizeThatFits(_:)

Returns the size of the view that will render the shape, given a proposed size.

## Declaration

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

## Parameters

- `proposal`: A size proposal for the container.

## Return Value

Return Value A size that indicates how much space the shape needs.

## Discussion

Discussion Implement this method to tell the container of the shape how much space the shape needs to render itself, given a size proposal. See sizeThatFits(proposal:subviews:cache:) for more details about how the layout system chooses the size of views.

## See Also

### Defining a shape’s size and path

- [path(in:)](swiftui/shape/path(in:).md)
