FontAwesome.swift 0,0,3,2 travis-ci CocoaPods

Use FontAwesome in your Swift projects

Star Fork Watch Issue Download
9 months after

FontAwesome.swift

Build Status CocoaPods Compatible Carthage Compatible Platform License

Use Font Awesome in your Swift projects

Installation

CocoaPods

To integrate FontAwesome into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'FontAwesome.swift'

Then, run the following command:

$ pod install

And add import FontAwesome_swift to the top of the files using FontAwesome.

Carthage

To integrate FontAwesome into your Xcode project using Carthage, specify it in your Cartfile:

github "thii/FontAwesome.swift" >= 0.4.1

Then add import FontAwesome to the top of the files using FontAwesome.

Manually

  • Drag and drop FontAwesome.otf and all Swift files into your project

Examples

FontAwesomeView - Storyboard

FontAwesome icon in label

label.font = UIFont.fontAwesomeOfSize(200)
label.text = String.fontAwesomeIconWithName(FontAwesome.Github)

FontAwesome icon in label from css class name

label.font = UIFont.fontAwesomeOfSize(200)
label.text = String.fontAwesomeIconWithCode("fa-github")

FontAwesome icon in button

button.titleLabel?.font = UIFont.fontAwesomeOfSize(30)
button.setTitle(String.fontAwesomeIconWithName(.Github), forState: .Normal)

FontAwesome icon as navigation bar item

let attributes = [NSFontAttributeName: UIFont.fontAwesomeOfSize(20)] as Dictionary!
leftBarButton.setTitleTextAttributes(attributes, forState: .Normal)
leftBarButton.title = String.fontAwesomeIconWithName(.Github)

FontAwesome icon as toolbar item

let attributes = [NSFontAttributeName: UIFont.fontAwesomeOfSize(20)] as Dictionary!
toolbarItem.setTitleTextAttributes(attributes, forState: .Normal)
toolbarItem.title = String.fontAwesomeIconWithName(.Github)

FontAwesome icon as an image

tabBarItem.image = UIImage.fontAwesomeIconWithName(.Github, textColor: UIColor.blackColor(), size: CGSizeMake(30, 30))

FontAwesome icon as an image with background color

tabBarItem.image = UIImage.fontAwesomeIconWithName(FontAwesome.Github, textColor: UIColor.blueColor(), size: CGSizeMake(4000, 4000), backgroundColor: UIColor.redColor())

Requirements

iOS 8 or later.

License

  • FontAwesome.otf file licensed under SIL OFL 1.1
  • FontAwesome.swift licensed under MIT

Related Repositories

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...

awesome-swift

awesome-swift

A curated list of awesome Swift frameworks, libraries and software. ...

awesome-swift

awesome-swift

A curated list of awesome Swift frameworks, libraries and software. ...

awesome-swift

awesome-swift

A curated list of awesome Swift frameworks, libraries and software. ...

awesome-swift

awesome-swift

A collaborative list of awesome swift resources. Feel free to contribute! ...


Top Contributors

thii shams-ahmed oliverdowling nanoxd marcelofabri HendX mpclarkson antonyalkmim Tulleb Imperiopolis bjonica alexkafer BenchR267 prrrnd ecnepsnai joubin King-Wizard planetexpress69 morizotter PiB02 ReadmeCritic katunch xslim arnaudlamy mimu0 muyexi timothybarraclough

Releases

-   0.11.1 zip tar
-   0.10.1 zip tar
-   0.10.0 zip tar
-   0.9.0 zip tar
-   0.8.0 zip tar
-   0.7.3 zip tar
-   0.7.1 zip tar
-   0.7.0 zip tar
-   0.6.3 zip tar
-   0.6.2 zip tar
-   0.6.1 zip tar
-   0.6.0 zip tar
-   0.5.0 zip tar
-   0.4.3 zip tar
-   0.4.2 zip tar
-   0.4.1 zip tar
-   0.4.0 zip tar
-   0.3.2 zip tar
-   0.3.1 zip tar
-   0.3.0 zip tar
-   0.2.1 zip tar
-   0.2.0 zip tar
-   0.1.0 zip tar