axl411
axl411

Reputation: 930

iOS setting custom font in interface builder does not work on device

I followed this step by step and successfully added a custom font in my project, I am able to change the font of my textView by setting my textView's font attribute programmatically.

In interface builder, I can also set the custom font using the font picker for my textView, and I can see that the font is applied to the textView in interface builder.

The problem is if I remove the code that sets the font, then the font on real device is still the system font despite that I already set the font in interface builder.

So how can I set the custom font in interface builder and make it work, without having to set the font in code?

Upvotes: 0

Views: 1446

Answers (3)

Thib L
Thib L

Reputation: 714

I had the same problem, I deleted the fonts from my app and put them back by using group creation and not folder reference, so my fonts appeared in "Copy Bundle Resources". Now it's working perfectly.

Upvotes: 2

MAK113
MAK113

Reputation: 1452

Go to Build Phases --> Copy Bundle resources

see Your custom font file is there or not .

It is not there then click on + sign and add it .

Before that check that you add font file in your project .

also check whether it is set in .plist file or not

Upvotes: 2

Pallavi Ligade
Pallavi Ligade

Reputation: 529

Steps which are done for Font is correct, but as per my understanding 2 things are there first is Xcode displays fonts which are found in the Mac OS or in your system, not on the actual iOS device. Before selecting a font, you should make sure it is available on iOS devices. and second is when we edit text in xib,custom Fonts appear, but at runtime it will not get applied. So it is better that you apply font pragmatically.
http://iosfonts.com/ , http://support.apple.com/en-in/HT202771 or even trial and error can help.

Upvotes: 1

Related Questions