Last active
August 29, 2015 14:07
-
-
Save y-ogi/5cb62e241873ca676da2 to your computer and use it in GitHub Desktop.
Using FontAwesome for RightBarButtonItem with Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let textAttributes = [ | |
NSFontAttributeName: UIFont(name: "FontAwesome", size: 18), | |
NSForegroundColorAttributeName: UIColor.redColor() | |
] | |
let rightBarButtonItem = UIBarButtonItem(title: "Search", style: .Plain, target: nil, action: nil) | |
rightBarButtonItem.setTitleTextAttributes(textAttributes, forState: .Normal) | |
rightBarButtonItem.title = NSString.awesomeIcon(FaSearch) | |
self.navigationItem.rightBarButtonItem = rightBarButtonItem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment