The key to make text view height follow it's content is by NOT SET HEIGHT CONSTRAINT and DISABLE THE SCROLL.
theTextView.isScrollEnabled = false
theTextView.text = "some text"
theTextView.sizeToFit()
But, if you already set the height constraint, then make it inactive
theTextViewHeightConstraint.isActive = false
theTextView.isScrollEnabled = false
theTextView.text = "some text"
theTextView.sizeToFit()