Skip to content

michaelzheng/typicons-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

typicons-swift

Use the Typicons font in your Swift projects.

Usage

Setup

  • Add the .swift file and the .ttf file to your Xcode project.
  • Go to the Build Phases tab of your project and add the ttf file to the 'Copy Bundle Resources' phase.
  • Go to the Info tab of your project. Under 'Custom iOS Target Properties', add the 'Fonts provided by application' array entry if it does not already exist. Add a new item to it and set the value to typicons.ttf.

Using the font

  • Creating a UIFont:
UIFont.typiconFontOfSize(50)
  • Setting the font of a control:
myButton.titleLabel?.font = UIFont.typiconFontOfSize:50
  • Setting text content of a control to an icon:
myButton.titleLabel?.text = String.typiconStringForIconName("arrow-right-thick")
  • To find the identifier for an icon, go to http://typicons.com and hover over an icon - the name of the icon will be displayed in the information section.

About

Use the Typicons font in Swift projects

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages