Handy UIFont Categories Allowing Custom Font Usage In Interface Builder

One of the more tedious aspects of working with interface builder is using custom fonts, but unfortunately you can’t use these fonts in interface builder.

Cedric Luthi has created a project called FontReplacer to solve this problem and explains this problem and exactly how FontReplacer solves this problem in the Readme:

If your project contains nibs with a lot of labels, it becomes tedious to setup an outlet for every label and change the font in the code for each outlet. Instead choose a font that you won’t be using anywhere in your app, e.g. Arial and use it in Interface Builder. Then create a mapping from Arial to your custom font, e.g. Caviar Dreams and let FontReplacer handle the replacement.

You simply need to add a key to your Info.plist file or NSDictionary and include the UIFont categories within your apps.

You can find FontReplacer on Github here with usage instructions and an example.

A very useful set of categories for working with custom fonts.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: Handy UIFont Categories Allowing Custom Font Usage In Interface Builder

©2012 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *