Coder Social home page Coder Social logo

fontawesome-ios's Introduction

FontAwesome-iOS

Brings the iconic FontAwesome font to iOS.

Installation

Add this to your Podfile:

pod 'FontAwesome'

This will include the helper files, and the font resource automatically in your app.

Usage

First, make sure you have FontAwesome.ttf bundled in your project and that UIAppFonts key in the project's plist file contains a String item named FontAwesome.ttf.

Then add the NSString+FontAwesome category to the project.

UILabel *label = [...]
label.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];

You can now use enums for all the different iconic characters

label.text = [NSString fontAwesomeIconStringForEnum:FAGithub];

or you can reference them by using the class identifiers listed here http://fortawesome.github.com/Font-Awesome/#all-icons

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

That's it! For further information have a look to the small demo project!

Placeholder Image

FAImageView is now extended and contains a new property called defaultView that is shown when the image is set to nil.

It is possible to use one the font-awesome icon as a default placeholder for an image view.

FAImageView *imageView = [[FAImageView alloc] initWithFrame:CGRectMake(0.f, 0.f, 100.f, 100.f)];
imageView.image = nil;
[imageView setDefaultIconIdentifier:@"fa-github"];

License

(forked from https://github.com/alexdrone/ios-fontawesome, to be available as a CocoaPod)

Attribution is no longer required as of Font Awesome 3.0 but is much appreciated: "Font Awesome by Dave Gandy - http://fontawesome.io".

fontawesome-ios's People

Contributors

a2 avatar alexdrone avatar arjunsharma avatar azmlucquin avatar ecnepsnai avatar jeremyanticouni avatar joshfuggle avatar metabren avatar paramaggarwal avatar runmad avatar vphamdev avatar xjrcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fontawesome-ios's Issues

UIFont n swift

Hi,
trying to apply font to label like this

UIFont.init(awesomeFontOfSize: 20)

but awesome font is not applied

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.