Swift Library for Font Icons
Please ★ this library.
Now, you don't have to download different libraries to include different font icons. This SwiftIcons library helps you use icons from any of the following font icons.
- Dripicons
- Emoji
- FontAwesome
- Icofont
- Ionicons
- Linearicons
- Map-icons
- Material icons
- Open iconic
- State face icons
- Weather icons
- TypIcons
SwiftIcons supports different objects from the object library.
- UIImage
- UIImageView
- UILabel
- UIButton
- UISegmentedControl
- UITabBarItem
- UISlider
- UIBarButtonItem
- UIViewController
- UITextfield
- UIStepper
Requirements
- iOS 9.0+
- Xcode 8
Installation
Cocoapods
CocoaPods is a dependency manager for Cocoa projects.
Make sure you have the latest version of CocoaPods by running:
Update your local specs repo by running:
Add the following lines to your Podfile
:
Then run the following command
You can start using the library by importing it wherever you want
Carthage
Carthage is a decentralized dependency manager for Cocoa projects.
Install the latest version of Carthage.
Add this line to your Cartfile
:
github "ranesr/SwiftIcons" ~> 3.0
or for master
,
github "ranesr/SwiftIcons" "master"
Then run carthage update --platform ios
and add the built framework to your project by following these instructions from Carthage.
Manually
Copy all the files from Source
folder.
Link to files.
- SwiftIcons.swift
- Dripicons.ttf
- Emoji.ttf
- FontAwesomeBrands.ttf
- FontAwesomeRegular.ttf
- FontAwesomeSolid.ttf
- Icofont.ttf
- Ionicons.ttf
- Linearicons.ttf
- MapIcons.ttf
- MaterialIcons.ttf
- OpenIconic.ttf
- Stateface.ttf
- WeatherIcons.ttf
- TypIcons.ttf
Check to import all ttf files in project, "Project" > "Target" > "Copy Bundle Resources"
Library Reference
You can check library reference documentation here.
Usage
- No more image icons any more
There are different font types for each of the font icons
Font Icons | Version | Font Types | Icons |
---|---|---|---|
Dripicons | 2.0 | dripicons | dripicons |
Emoji | emoji | emoji | |
FontAwesome | 5.1.0 | fontAwesome | fontAwesome |
Icofont | 1.0.0 Beta | icofont | icofont |
Ionicons | 2.0.1 | ionicons | ionicons |
Linearicons | 1.0.0 | linearIcons | linearIcons |
Map-icons | 3.0.2 | mapicons | mapicons |
Material icons | 2.2.0 | googleMaterialDesign | googleMaterialDesign |
Open iconic | 1.1.1 | openIconic | openIconic |
State face icons | state | state | |
Weather icons | 2.0.10 | weather | weather |
TypIcons | 2.0.7 | TypIcons | Typicons |
When setting an icon to any object, you have to mention which font type it is and then select which icon you want to set from that particular font icon.
UIImage
UIImageView
UILabel
UIButton
UISegmentedControl
UITabBarItem
UISlider
UIBarButtonItem
UIViewController
UITextfield
UIStepper
Examples
Please check out the SwiftIcons App. In the demo project, if you click on any object, you will see the method description in the logs for the icon of that object.
SwiftIcons Mentions & Usage
- Fabcoding Article by Zeba Rahman, same content in Medium post: Fabcoding Medium Post
- Classmate by Raheel Shah
- Open Source Projects, Collection of open source projects
- Mention on Awesome iOS, A curated list of awesome iOS ecosystem
- Medium Article on Storyboard by Malcolm Kumwenda
- Sentence used in the article: This is literally the only place that I made use of the SwiftIcons library but I thought it would be beneficial to show off a cool library that makes working with icons absolutely awesome.
If you are using SwiftIcons in your app and want to be listed here, simply create a new issue here.
I am always curious who is using my projects ?
Author
Saurabh Rane
Special thanks to Patrik Vaberer and his initial work on Font-Awesome-Swift library
Licence
SwiftIcons is available under the MIT License. See the LICENSE
file for more info.