Sam Jarman Sam Jarman - 29 days ago 10
iOS Question

Set a default font for whole iOS app?

I have a custom font I want to use for everything displaying text in my app, labels, text views etc.

IS there a way to set the default font (labels by default use SystemFont) for the whole app?

Answer

It seems to be possible in iOS 5 using the UIAppearance proxy.

 [[UILabel appearance] setFont:[UIFont fontWithName:@"YourFontName" size:17.0]];

That will set the font to be whatever your custom font is for all UILabels in your app. You'll need to repeat it for each control (UIButton, UILabel, etc.).

Remember you'll need to put the UIAppFonts value in your info.plist and include the name of the font you're including.