I have spent several days on this with no solution in sight.
I have an inputAccessoryView which consists of a UIView containing a textV
inputAccessoryView
UIView
textV
Fast forward to 2020, you can just do the following, everything else the same as in maxkonovalov's answer
override var intrinsicContentSize: CGSize { return .zero } // MARK: UITextViewDelegate func textViewDidChange(_ textView: UITextView) { sizeToFit() }