I'm trying to use iOS FontAwesome to set an icon on a bar button, like this:
[self.barButton setTitle:[NSString fontAwesomeIconStringForEnum:FACamera]];
and also with this:
[self.barButton setTitle:[NSString fontAwesomeIconStringForIconIdentifier:@"fa-camera"]];
No matter what identifier I use the result is the same:
What could be wrong?
In case anyone else ever wonders:
Just in case you want to use easier solution without using attributed texts, look at my library. Cocoa pods are also supported. Font Awesome Swift
With the FontAwesomeKit 2.2 API, you can do it like this:
Or convert to
UIImage
like suggested in the FontAwesomeKit documentation:In Swift: