iOS : How to use FontAwesome in Xcode project.

Umair Hassan Baig
2 min readJun 30, 2017

--

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/
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.

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

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.

Sample xib: Icons shown with font awsome

--

--