I am trying to get the content height of an UITextView for calculating the bottom position of it (y position + height). I can get the y position just fine with
travelDescriptionTextView.frame.origin.y
and need to determinate the height. All over the internet it says to get the content height with:
let contentSize = self.travelDescriptionTextView.sizeThatFits(self.travelDescriptionTextView.bounds.size)
let height = contentSize.height
but this technique doesn't work when height is resized (extended) by word wrapping, that is, if a sentence is wider than the width of the text box and the textbox creates a new line automatically. The above technique for getting content height only get the height right if there is no word wrapping, or else the height is excluding the extra word wrapping lines causing the content height to be shorter than the actual content height.
So how do I get the content height of a UITextView containing word wrapping height resizes?