Skip to content

RBevilacqua/FontAwesome.swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.6%
  • Ruby 2.4%