I have tried this but it didn\'t work, the text is out of the button boundaries.
button.titleLabel!.adjustsFontSizeToFitWidth = true button.titleLabel!.numberOfL
UIButton font scaling can be very fickle, I've had problems with it in the past. What I did was make the number of lines equal to 1, which worked for me.