when i set adjustsFontSizeToFitWidth to the button UILabel, the text go out side of the button frame, I don't know why ?
here is my code:
shareBtn = UIButton()
shareBtn.setTitle(IconsConstants.share, forState: UIControlState.Normal)
shareBtn.titleLabel?.font = UIFont.iconmoonFont(100)
shareBtn.titleLabel?.adjustsFontSizeToFitWidth = true;
shareBtn.contentVerticalAlignment = UIControlContentVerticalAlignment.Center
shareBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignment.Center
//EdgeInsets
shareBtn.contentEdgeInsets = UIEdgeInsets.init(top: 10, left: 10, bottom: 10, right: 10)
and here is the result: