Font Awesome for iOS application

If you are an iOS developer, you should face with so many icons in an application. You have to cut, resize or change the color of them to use with UIImageView, UIButton,… And it’ll be more difficult to control the title & image of an UIButton, than only control the attributed title with NSAttributedString.

Font Awesome gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS.

I would like to introduce a library, which I’m using in many projects. Currently it supports Font-Awesome, Foundation icons, Zocial, and ionicons.

iOS library:

FontAwesomeKit

Example:

NSError *error;
FAKFontAwesome *starIcon = [FAKFontAwesome iconWithIdentifier:@"fa-star" size:15 error:error];
[starIcon addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor]]

 

Use as attributed string:

self.label.attributedText = [starIcon attributedString];

 

Use as an image:

UIImage *iconImage = [starIcon imageWithSize:CGSizeMake(15, 15)];

 

Use as image (with multiple icons stacked together):

[UIImage imageWithStackedIcons:@[[FAKFontAwesome twitterIconWithSize:35], [FAKFontAwesome squareOIconWithSize:70]] imageSize:CGSizeMake(80, 80)];

 

You simply use the provided helper libraries to use the icon names as listed on the FontAwesome icon page.

Link to find the icon name:

The Icons

Congratulation & Good luck !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s