Latest 4.3.2
Homepage https://github.com/jeremyanticouni/JAFontAwesome
License Private Originally forked from Alex Drone’s [ios-fontawesome](https://github.com/alexdrone/ios-fontawesome) and uses the String+FontAwesome.swift addition from [Riz](https://github.com/rsattar/ios-fontawesome). This project also uses the FontAwesome fix made by [Pit Garbe](https://github.com/leberwurstsaft/FontAwesome-for-iOS).

A mention of ‘Font Awesome – http://fortawesome.github.com/Font-Awesome’ in human-readable source code is considered acceptable attribution (most common on the web). If human readable source code is not available to the end user, a mention in an ‘About’ or ‘Credits’ screen is considered acceptable (most common in desktop or mobile software.)

Platforms ios 5.0, requires ARC
Frameworks UIKit, Foundation, CoreGraphics
Authors

Font awesome is, well, awesome. If you don’t know about it, go here, we’ll wait.

This category makes it drop-dead simple to use in iOS.

Installation

First, you’ll need to tell Xcode that you want to include the FontAwesome font. the font file and add it to your Xcode project.

  1. Download fontawesome-webfont.ttf.
  2. Drag it into your Xcode project. When prompted, make sure these options are selected: ‘Copy items if needed,’ ‘Create groups,’ and there is a tickmark next to your target.
  3. In your Info.plist, look for Fonts provided by application or UIAppFonts. If it doesn’t exist, add it, making sure that it is an array.
  4. Add a new string to the UIAppFonts array: fontawesome-webfont.ttf.

Next, assuming CocoaPods is already installed, simply add JAFontAwesome to your podfile and then run pod update:

pod 'JAFontAwesome'

If you need to install CocoaPods, go here.

Finally, add the NSString+FontAwesome category to the project:

#import "NSString+FontAwesome.h"

Usage

First, let’s create a label and define the size and font:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
label.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];

Now, we can use enums to display an icon..

label.text = [NSString fontAwesomeIconStringForEnum:FAGithub];

..or you can reference them by using the class identifiers listed here, like so:

label.text = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-github"];

Enjoy!

License

Originally forked from Alex Drone’s ios-fontawesome and uses the String+FontAwesome.swift addition from Riz. This project also uses the FontAwesome fix made by Pit Garbe.

A mention of ‘Font Awesome – http://fortawesome.github.com/Font-Awesome‘ in human-readable source code is considered acceptable attribution (most common on the web). If human readable source code is not available to the end user, a mention in an ‘About’ or ‘Credits’ screen is considered acceptable (most common in desktop or mobile software.)

Latest podspec

{
    "name": "JAFontAwesome",
    "version": "4.3.2",
    "summary": "Category that makes FontAwesome even easier for iOS.",
    "homepage": "https://github.com/jeremyanticouni/JAFontAwesome",
    "license": {
        "type": "Private",
        "text": "Originally forked from Alex Drone's [ios-fontawesome](https://github.com/alexdrone/ios-fontawesome) and uses the String+FontAwesome.swift addition from [Riz](https://github.com/rsattar/ios-fontawesome). This project also uses the FontAwesome fix made by [Pit Garbe](https://github.com/leberwurstsaft/FontAwesome-for-iOS).nnA mention of 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable source code is considered acceptable attribution (most common on the web). If human readable source code is not available to the end user, a mention in an 'About' or 'Credits' screen is considered acceptable (most common in desktop or mobile software.)n"
    },
    "authors": {
        "Jeremy Anticouni": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jeremyanticouni/JAFontAwesome.git",
        "tag": "4.3.2"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source_files": "*.{h,m}",
    "exclude_files": "Demo",
    "resources": "Resources/*.ttf",
    "frameworks": [
        "UIKit",
        "Foundation",
        "CoreGraphics"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This