Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.32 KB

README.md

File metadata and controls

49 lines (36 loc) · 1.32 KB

Ionicons.swift

Use Ionicons in you swift projects. The similar to FontAwesome.swift

Installation

  • Drag and drop Ionicons.ttf and Ionicons.swift files into your project

Examples

Ionicons icon in label

label.font = UIFont.ioniconOfSize(200)
label.text = String.ioniconWithName(Ionicons.SocialGithub)

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

Ionicons icon in label from css class name

label.font = UIFont.ioniconOfSize(200)
label.text = String.ioniconWithCode("ion-alert")

Ionicons icon in button

button.titleLabel?.font = UIFont.ioniconOfSize(30)
button.setTitle(String.ioniconWithName(.SocialGithub), forState: .Normal)

Ionicons icon as navigation bar item

leftBarButton.setTitleTextAttributes(attributes, forState: .Normal)
leftBarButton.title = String.ioniconWithName(.SocialGithub)

Ionicons icon as toolbar item

toolbarItem.setTitleTextAttributes(attributes, forState: .Normal)
toolbarItem.title = String.ioniconWithName(.SocialGithub)

Requirements

iOS 7 or later.

License

  • Ionicons.ttf file licensed under MIT
  • Ionicons.swift licensed under MIT