1

I want to set the custom font to UILabel in storyboard. I have .ttf file of font. I searched about it on google, everybody is setting the font programmatically.

Mohit
  • 3,708
  • 2
  • 27
  • 30
Rakesh
  • 1,177
  • 1
  • 15
  • 31

3 Answers3

7

Select the control (label) and add User Defined Runtime Attribute (Key Path set to fontName , Type set to String and Value set to the name of your custom font).

Note:

Make sure that you've added the font to the project - tutorial

enter image description here

Community
  • 1
  • 1
Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102
  • Thank you.. Partially solved my problem. I referred this link to solve my problem. http://stackoverflow.com/questions/9090745/custom-font-in-a-storyboard/15155081#15155081 – Rakesh Aug 21 '14 at 11:34
1

The good news is that this is a new feature added to the Interface Builder in Xcode 6 as documented here

John Keyes
  • 5,479
  • 1
  • 29
  • 48
Mike Pollard
  • 10,195
  • 2
  • 37
  • 46
1

Connect Your IBOutlet to Label and you can set like this,

lblHeading.font = [UIFont fontWithName:@"ApexNew-Bold" size:17];

in the above code ApexNew-Bold is custom font and you need to add it in Plistfile.

enter image description here

Balu
  • 8,470
  • 2
  • 24
  • 41