I am trying to find a non-deprecated method to size the font of a textview down so that all text fits in the textview without requiring scrolling.
The method \'sizeWithF
Try UITextView's sizeThatFits
. You can probably use it the following way:
//Set text content of UITextView
//...
while (fontSize > minSize) {
// Set font size of UITextView
CGSize size = [textView sizeThatFits:(CGSizeMake(textView.frame.size.width, FLT_MAX)];
if (size.height <= newView.frame.size.height) break;
fontSize -= 1.0;
}