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
UITextView is subclass of UIScrollView -> so you can check the contentSize of the scrollable area after you set your text or font into textView.
textView.text = quote;
do
{
textView.font = [UIFont fontWithName:@"Interstate" size:fontSize];
[textView layoutIfNeeded];
if (textView.contentSize.height <= newView.frame.size.height) {
break;
}
fontSize -= 1.0;
} while (fontSize >= minSize);
That should work... Probably it would work even without [textView layoutIfNeeded].