Set a default font for whole iOS app?

Sam Jarman picture Sam Jarman · Jan 3, 2012 · Viewed 109.2k times · Source

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

Randall picture Randall · Jan 3, 2012

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.