Yeah, there\'s this cool myLabel.adjustsFontSizeToFitWidth = YES;
property. But as soon as the label has two lines or more, it won\'t resize the text to anythin
All these are interesting solutions to the original problem, however all of them are also missing an important thing: If you solely rely on the familyName to get the next font to test, you're losing the weight information and possibly more advanced attributes like small caps, figure style, etc.
A better approach is instead of passing the font name around and doing [UIFont fontWithName:someFontName size:someFontSize]
, passing UIFontDescriptor
objects along and then doing
[UIFont fontWithDescriptor:someFontDescriptor size:someFontSize]
.