TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by David Sweetman.
Easily use FontAwesome icons in your iOS projects
Currently using FontAwesome 4.0
Font Awesome by Dave Gandy - http://fontawesome.io
For available icons, look at font-awesome-codes.h or browse them at the FontAwesome website.
Get the FontAwesome font:
UIFont *fontAwesome = [FontAwesome fontWithSize:30.0f];
Make a UILabel with a FontAwesome Icon:
UILabel *label = [FontAwesome labelWithIcon:fa_cutlery size:20.0f color:[UIColor blackColor]];
Adjust an existing UILabel to show a FontAwesome Icon:
[FontAwesome label:existingLabel
setIcon:fa_cutlery
size:20.0f
color:[UIColor blackColor]
sizeToFit:YES];
Render a FontAwesome Icon in a UIImage:
UIImage *icon = [FontAwesome imageWithIcon:fa_cutlery
iconColor:[UIColor redColor]
iconSize:60.0f
imageSize:CGSizeMake(90.0f, 90.0f)];
Or if you happen to have an alternate icon font, and just want to use the image rendering code with your own font:
UIImage *icon2 = [FontAwesome imageWithText:@"\uf190"
font:[UIFont fontWithName:@"FontAwesome" size:60.0f]
iconColor:[UIColor redColor]
imageSize:CGSizeMake(90.0f, 90.0f)];
CocoaPods is great:
pod 'FontAwesomeTools'
to your Podfilepod install
Non-CocoaPods is easy too:
Modify your project's Info.plist file:
There are already a couple FontAwesome libraries for iOS, here is why I decided to make this one:
I built this for inclusion in my app design templates available at TapTemplate