Friday 30 November 2012

How to add custom fonts to your iOS app

To have well designed UI in any app, we need to have some thing different then any other apps. This may be in terms of images, colors, contents, fonts, text styles, way of presentation. And suppose if the Xcode doesn't have the required things which we required.

Here is a tip for how to add your own custom font to use in any iOS app just in 3 steps.

1) Add the font file to your resource bundle, the file extension will be “otf”. Here is a font file of STIXGeneral.

2) Add the font info in your application info.plist file, once added your info.plist file will look similar like below.









3) Then nothing, just use the font any where in your app as required. The one is shown below, similarly


[_myLabel setFont:[UIFont fontWithName:@”STIXGeneral” size:44]];


That's it now your UI shows your own custom font.

Thanks
Happy Coding.

No comments:

Post a Comment