<p>Is there a good way to adjust the size of a <code>UITextView</code> to conform to its content? Say for instance I have a <code>UITextView</code> that contains one line of text:</p>

<pre><code>"Hello world"
</code></pre>

<p>I then add another line of text:</p>

<pre><code>"Goodbye world"
</code></pre>

<p>Is there a good way in Cocoa Touch to get the <code>rect</code> that will hold all of the lines in the text view so that I can adjust the parent view accordingly?</p>

<p>As another example, look at the notes' field for events in the Calendar application - note how the cell (and the <code>UITextView</code> it contains) expands to hold all lines of text in the notes' string.</p>

Did you try
```
[textView sizeThatFits:textView.bounds]
```
?
Edit: sizeThatFits returns the size but does not actually resize the component. I'm not sure if that's what you want, or if
```
[textView sizeToFit]
```
is more what you were looking for. In either case, I do not know if it will perfectly fit the content like you want, but it's the first thing to try.