How to size a UITextView to its content in swift?

Posted by Rohit Kumar | Updated on

How to size a UITextView to its content in swift. This works for both iOS 6.1 and iOS 7:

Or in Swift (Works with Swift 4.1 in iOS 11)

If you want support for iOS 6.1 then you should also:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers