Skip to content

Use your Icomoon fonts with Swift - auto-generates type safe enums for each icon

License

Notifications You must be signed in to change notification settings

getkalido/Icomoon.swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icomoon.swift

Use your Icomoon fonts with Swift - auto-generates type safe enums for each icon

Installation

  1. Download or clone this repo.
  2. Run make. That's it. (You can run make uninstall to uninstall.)

Usage

Generate framework

  1. Download your font file from Icomoon (usally called icomoon.zip)
  2. Run icomoon-swift icomoon.zip
  3. Add the generated Icomoon.framework to your Xcode project and create a copy-frameworks step in your build phases

API

The generated framework extends UIFont, UIImage and String and generates an enum Icon. Cases are automatically created based on the name on Icomoon. (Example: my-search becomes .MySearch)

import Icomoon

let searchIcon = UILabel()
searchIcon.text = String.iconWithName(.MySearch)
searchIcon.font = UIFont.iconOfSize(30)

About

Use your Icomoon fonts with Swift - auto-generates type safe enums for each icon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 44.2%
  • Shell 34.6%
  • Python 11.4%
  • Objective-C 7.0%
  • Makefile 2.8%