Skip to content

eurus/Swift-Font-Awesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Swift Font Awesome

Swift Font Awesome is a Swift extension for NSString. Easily use the icons from Font Awesome in your Swift project.

Features

  • Enums for all of the icons, insert icons quick and easy with autocomplete
  • Use the class names from the Font Awesome website
  • Updated to Font Awesome version 4.2.0

Requirements

  • iOS 7.0+ / Mac OS X 10.9+
  • Xcode 6.1

Installation

You have to include the FontAwesome.ttf font-file (download here) and include it in your project. Then add the file to the Fonts provided by application key in your projects' plist file. Then add NSString+FontAwesome.swift to your project.

Usage

Create a UI element as per usual and set Font Awesome as it's font

var label = UILabel()
label.font = UIFont(name: "FontAwesome", size: 16.0)

Assign an icon as the label's text using an enum

label.text = NSString().fontAwesomeIconStringForEnum(.FAGithub)

Assign an icon as the label's text using it's classname

label.text = NSString().fontAwesomeIconStringForIconClassName("fa-github")

Font Awesome

Learn more about Font Awesome on it's website

Creator

License

Swift Font Awesome is available under the MIT license. See LICENSE for details.

Please note that Font Awesome has it's own license.

About

Font Awesome with Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages