How to use Font Awesome in Swift

Font Awesome is a famous iconic font. In a case, iconic font is useful because we can use many icons without a lot of small files.

Follow the below steps to integrate Font Awesome in your Xcode project.

  1. Create a project in xcode.
  2. Download the zip font form http://fontawesome.io/Font Awesome Source
  3. Unzip the folder and drag fonts/fontawesome-webfont.ttf into your projectfont awesome drag
  4. Open Info.plist file
    • Add a new key “Fonts provided by application”. This is of type Array.
    • Expand the array, and for Item 0, set the string value to “fontawesome-webfont.ttf”

info.plist file

Congratulations, you have integrated font awesome into your project

How to use Font Awesome

  1. Drop a label on View Controller
  2. Set the font to “Custom”, and the family to FontAwesome
  3. Set the font size to 50Storyboard label
  4. Connect label to your view controller with IBOutlet
  5. Set the label text by using of font awesome unicode.IBOutlet with labelOUTPUT
    output

 

That’s It. If you like this post, Please comment below and subscribe this blog.

Leave your comments

Advertisements