1

I know how to add custom font files to be shipped with an iOS app. I can then customize the label font from code using code like this :

UIFont* font = [UIFont fontWithName:@"League Gothic" size:42];
self.topLabel.font = font;

My concern is that such customization will "infect" all of the project and may require some significant rework later on. Is there a way to include a font file into xCode itself, so it recognizes it and lets me select it from the storyboard font control?

Jon Hess
  • 14,237
  • 1
  • 47
  • 51
Alex Stone
  • 46,408
  • 55
  • 231
  • 407

2 Answers2

8

You can find the answer to this question over here

Designing labels/text views with custom fonts in Interface Builder

You can find a link regarding the same topic here

http://www.abdus.me/ios-programming-tips/set-custom-fonts-in-interface-builder/

Hope this helps you.

Community
  • 1
  • 1
Rajat
  • 1,043
  • 12
  • 23
0

Another way to achieve it without having to relay on exposing IBOutlets or adding external libraries is using categories and user defined runtime attributes from Storyboard or Interface Builder.

That way you can define your fonts in Storyboard or IB like this:

Runtime Attributes

You can get the code required for the categories from this response.

Community
  • 1
  • 1
redent84
  • 18,901
  • 4
  • 62
  • 85