iOS : How to use FontAwesome in Xcode project.

The benefits of using font-awesome for icons is that you can treat them just like text. It eliminates the need of using pngs of varied sizes or varied colors of a same icon as you can just set the font size or font color to induce the effect of your desire.

  1. Download font-awesome from http://fontawesome.io/
Image for post
Image for post
Font-awesome Web Page. Click the Download

2. Add the fontawesome-webfont.ttf to your project.
3. Make sure you have checked the membership of the fontawesome-webfont.ttf file in the target you want to use the font. You can do this by selecting the file in your project navigator.

Image for post
Image for post

4. Open your project’s Info.plist file and add the key “Fonts provided by application in your” and add the name of .ttf file under it.

5. Now open http://fontawesome.io/cheatsheet/ and select the “ICON” of your desire like shown below and press “command + c” i.e copy

Image for post
Image for post

6. Now open your xib with the interface builder. Suppose we are using this icon on a button as shown below. Now select the button and paste that icon you have copied in the Title field shown in Attribute Inspector. After that select the font of the button to be “FontAwesome”. You can also set it programmatically for sure.

Image for post
Image for post
Sample xib: Icons shown with font awsome
Image for post
Image for post

Software Architect & Developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store