Skip to content

Elegantly use ZMDI (Material Design Iconic Font) and FontAwesome icons in Swift for iOS.

License

Notifications You must be signed in to change notification settings

daaavid/SwiftFontIcons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftFontIcons

Elegantly use ZMDI (Material Design Iconic Font) and FontAwesome icons in Swift for iOS.

CI Status Version License Platform

Usage

Use is easy as 🍰; type the icon code you want to use followed by .zmdi or .fa and then .icon or .image. This will return an optional String and UIImage, respectively. If you're using .icon, remember to set the font for the label / button / whatever beforehand.

label.font = .zmdi(size: 20)
label.text = "zmdi-remote-control".zmdi.icon

label.font = .fa(size: 20)
label.text = "fa-user".fa.icon
imageView.image = "zmdi-remote-control".zmdi.image(color: .white, size: imageView.frame.size)
imageView.image = "fa-user".fa.image(color: .white, size: imageView.frame.size)

Prefacing the icon code with fa or zmdi is unnecessary; you can drop it off if you want.

label.text = "address-book".fa.icon
label.text = "satellite".zmdi.icon

Check out this Example Code for more usage examples.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

SwiftFontIcons is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwiftFontIcons'

If you get some sort of spec error, try pod repo update or:

pod 'SwiftFontIcons', :git => 'https://github.com/daaavid/SwiftFontIcons.git', :branch => 'master'

Author

daaavid, [email protected]

License

SwiftFontIcons is available under the MIT license. See the LICENSE file for more info.

About

Elegantly use ZMDI (Material Design Iconic Font) and FontAwesome icons in Swift for iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published