I am using the code below for calculate the height of text, then set this height for UILabel and UITextView
UILabel
UITextView
CGSize targetSize = CGS
You don't need to calculate Height of UITextview based on text.
UITextview
Just change frame and set height like this:
textview.size.height = textview.contentSize.height;
This is easy solution. I hope this helps you.