joubin / FontAwesome.swift

Use FontAwesome in your Swift projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FontAwesome.swift CI Status

Use Font Awesome in your Swift projects

Installation

  • Drag and drop FontAwesome.otf and FontAwesome.swift files into your project

Examples

FontAwesome icon in label

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

let attributes = [NSFontAttributeName: UIFont.fontAwesomeOfSize(20)] as Dictionary!

FontAwesome icon in button

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

FontAwesome icon as navigation bar item

leftBarButton.setTitleTextAttributes(attributes, forState: .Normal)
leftBarButton.title = String.fontAwesomeIconWithName(.Github)

FontAwesome icon as toolbar item

toolbarItem.setTitleTextAttributes(attributes, forState: .Normal)
toolbarItem.title = String.fontAwesomeIconWithName(.Github)

FontAwesome icon as a (tabbaritem's) image

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

Requirements

iOS 7 or later.

License

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

About

Use FontAwesome in your Swift projects

License:MIT License


Languages

Language:Swift 97.6%Language:Ruby 2.4%