TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Giovanni Lodi.
Speedup your iOS app development using icon fonts!
Icon fonts are very popular in the web development world. And they are awesome. With Stencils you can now access the power and awesomeness of icon fonts in the development of your iOS app, and save a lot of emails with the designer to get the new asset with the shadow 0.5 point more to the left and 3.141592% less opaque.
Via CocoaPods.
pod 'Stencils'
or
pod 'Stencils', ~> 'x.x.x'
where x.x.x
is the version number you want. Latest stable is
Three simple steps:
Just add the .ttf
to the project. No Info.plist
update needed! And you can even add multiple icon fonts.
Stencils needs to know how to read the font file. Create a configuration file, by default Stencils will look for Stencils.plist
, in this fashion:
font-icons Array
Item 0 Dictionary
font-name String The name of the font where the icon is located
icon-name String The name to use to load the icon
icon-code String The unicode caracter corresponding to the icon
i.e: e001
baseline-adjustement Number (Optional) A correction value to compensate eventual offset from the baseline
scale-adjustement Number (Optional) A correction value to change the scale of the icon. Usually used with "baseline-adjustement"
Have a look at the example projects to see how a real configurations plist
looks like.
STIconsFactory
and STIconView
#import <StencilsFactory.h>
STIconsFactory *factory = [[StencilsFactory alloc] init];
STIconView *arrow = [iconFactory iconViewForIconNamed:@'arrow-left' withSide:60.0f];
You can customize your icon like this:
arrow.background = [UIColor white];
arrow.color = [UIColor black];
// If no color is set the icon will use the tintColor of it's superview
arrow.shadowColor = [UIColor gray];
arrow.shadowOffset = CGSizeMake(1.0f, 1.0f);
username/feature_name