I read many tutorials explaining how to add custom fonts to iOS apps.But in every tutorials its done through code.I mean, if i need change the font of 10 labels,i have to write code for each labels.I would like to know is there any method to add custom fonts to my project and then select that font from the storyboard ,i mean from the attributes list of label object.. Please help me in solving this....
-
2https://github.com/deni2s/IBCustomFonts I find this to be the best solution – Milo Jan 11 '14 at 10:52
4 Answers
That cannot be achieved through the interface builder only. However you can create a custom class subclassing UILabel
. You define the .m file as follows:
@implementation CustomLabel
-(void) awakeFromNib{
[super awakeFromNib];
self.font = [UIFont fontWithName:@"<your custom font's file name>" size: self.font.pointSize];
//set other settings of the custom label here (colour, etc.)
}
@end
Then in the .xib file whenever you use a UILabel
, set the class to be CustomLabel
.

- 2,241
- 1
- 24
- 38
This can be done in Storyboard or Interface Builder with the use of very simple categories and user defined runtime attributes.
Something like this:
Please check this response for more details on how to achieve it.
Try This One:
UIFont *font = [UIFont fontWithName:@"YourFontName(without Extension)" size:30.0f];
self.yourLabel.font=[font fontWithSize:28];
add your font name in your projectname.plist like this
Fonts provided by application ---->Array------>2(items)
item0 --------->string----->urfontname with extension(ttf/otf) also
item1 --------->string----->secondfont name with extension(ttf/otf) also

- 891
- 1
- 9
- 22
This could now be done through Interface Builder in Xcode 6.
Now when you add custom font to your project and after making sure it is properly setup in your target settings, you should see your font in the regular font selector. Simply select Font > Custom, Family > your custom font should be listed here.
I currently have a bug after selecting the font in beta5 but this is how to do it. I installed Xcode 6 only for this feature (far more convenient than defining it programmatically everywhere).

- 37,241
- 25
- 195
- 267

- 718
- 12
- 14