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

# sizeThatFits(_:)

Returns the space needed by the text view, for a proposed size.

## Declaration

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

## Parameters

- `proposal`: The proposed size of the text view.

## Return Value

Return Value The size that the text view requires for the given proposal.
