Autoshrink setting for UIButton in Storyboard Autoshrink setting for UIButton in Storyboard ios ios

Autoshrink setting for UIButton in Storyboard


You can use User Defined Runtime Attributes to set this flag using the storyboard.

Set the following key path:

titleLabel.adjustsFontSizeToFitWidth to true

Adjust Font Size using Storyboard


No, there is no option available in storyboard for set Button's textlabel auto-shrink ,

But you can set it programatically with adjustsFontSizeToFitWidth as you are aware with it.

yourbutton.titleLabel?.adjustsFontSizeToFitWidth = true;


try this

btn.titleLabel.adjustsFontSizeToFitWidth = YES;btn.titleLabel.minimumScaleFactor = 0.5; // set whatever factor you want to set 

If you want to set in storyboard try IBDesignable and IBInspectable

refer http://nshipster.com/ibinspectable-ibdesignable/