PrideChung / FontAwesomeKit

Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using FAK in nibs/xibs

guyisra opened this issue · comments

commented

Is there anyway to use some kind of variation of the icons in xibs as placeholders?

Right now, I have a static image which sort of looks like the FAK icon generated in code. Is there a way around this?

You can, but it's not very straightforward. For starters, you won't be able to do icons rendered into UIImage instances for putting into a UIImageView, but you will be able to use the textual versions of the icons.

In IB, create a UILabel, or anything that can handle an NSAttributedString. Set its font to whichever icon font you want (FontAwesome, Ionicons).

Go to that font's website and check out their "cheatsheet", for example:

FontAwesome: https://fortawesome.github.io/Font-Awesome/cheatsheet/
Ionicons: http://ionicons.com/cheatsheet.html
(a quick Google will find the others)

Copy the icon you want, paste into the label, and smile.