I have several UIButton
's together, and I want to adjust the font size so that it fits. However, each button should use the same font size so that they look the same. In other words, what I would like to do is set all button to the same minimum size.
_button1.titleLabel.adjustsFontSizeToFitWidth = YES;
_button2.titleLabel.adjustsFontSizeToFitWidth = YES;
float minFont1 = _button1.titleLabel.font.pointSize;
float minFont2 = _button2.titleLabel.font.pointSize;
float fontSize = MIN(minFont1, minFont2);
UIFont *tailoredFont = [_button1.titleLabel.font fontWithSize:fontSize];
_button1.titleLabel.font = tailoredFont;
_button2.titleLabel.font = tailoredFont;
However, this does not work because the titleLabel.font does not reflect the true size of the font.