How to make UITextView’s height dynamically?

Fredric Cliver
Feb 19, 2021

--

Photo by Andrew Neel on Unsplash

When you’re using UITextView to allow user write on something, it’s height is not being changed. Then, if you consider to use UITextField, it’s not allowed to be written down more than 1 row.

What you have to do for it is just one line of code.

yourTextView.isScrollEnabled = false

And then your UITextView will be resized just like this.

--

--

Fredric Cliver

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧