Skip to content

Instantly share code, notes, and snippets.

@pocketkk
Created August 25, 2014 17:05
Show Gist options
  • Save pocketkk/c116d49a9c3a34f06684 to your computer and use it in GitHub Desktop.
Save pocketkk/c116d49a9c3a34f06684 to your computer and use it in GitHub Desktop.
UINavigationBar Customization
let red : CGFloat = 150/255
let green : CGFloat = 212/255
let blue : CGFloat = 86/255
let navBarColor : UIColor = UIColor(red: red, green: green, blue: blue, alpha: 1.0)
// let shadow = NSShadow()
// shadow.shadowOffset = CGSizeMake(0.0, 1.0)
// shadow.shadowColor = UIColor.whiteColor()
let titleDict: NSDictionary = [
NSForegroundColorAttributeName: UIColor.darkGrayColor(),
NSFontAttributeName: UIFont(name: "HelveticaNeue-Thin", size: 20)
]
let barTextDict: NSDictionary = [
NSForegroundColorAttributeName: UIColor.darkGrayColor(),
//NSShadowAttributeName: shadow,
NSFontAttributeName: UIFont(name: "HelveticaNeue-Thin", size: 17)
]
UIBarButtonItem.appearance().setTitleTextAttributes(barTextDict, forState: UIControlState.Normal)
self.navigationController.navigationBar.titleTextAttributes = titleDict
self.navigationController.navigationBar.barTintColor = navBarColor
self.navigationController.navigationBar.translucent = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment