Reputation: 2099
I want to be able to scale the font size on a storyboard per screen size without writing code to do this, is this possible.
I already tried to set up constraints to adjust the label and set the font scaling factor but what happens then it depending on how long the text is I end up getting a screen that has different font sizes rather than all of the font for that screen being the same size?
Upvotes: 3
Views: 8540
Reputation: 14379
Xcode provides auto shrinks facility, Which adjust based on screen size Goto Attribute inspector-> Autoshrinks -> Minimum font scale set it to 0.5 or your desired value.
Programmatically
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.5
Upvotes: 4
Reputation: 28982
You can add variations inside the property inspector based on the different devices:
Note, however, that this will not distinguish between all devices...
Upvotes: 0