Skip to content

Instantly share code, notes, and snippets.

@garymansted
Last active August 4, 2016 09:39
Show Gist options
  • Save garymansted/686712ff9b41c737b2a64dc4af43e7a0 to your computer and use it in GitHub Desktop.
Save garymansted/686712ff9b41c737b2a64dc4af43e7a0 to your computer and use it in GitHub Desktop.
Change navigation bar title text font attributes in code SWIFT
//Set up in viewDidLoad()
let attributes = [NSForegroundColorAttributeName : UIColor.whiteColor(), NSFontAttributeName : UIFont(name: "HelveticaNeue-Light", size: 24)!]
//Set the navigation bar attributes
self.navigationController?.navigationBar.titleTextAttributes = attributes
self.navigationController?.navigationBar.translucent = false
self.navigationController?.navigationBar.barTintColor = UIColor.blackColor()
self.navigationController?.title = "Hello World!"
@garymansted
Copy link
Author

Copy and paste code in the viewDidLoad() . Change the font, size and text as you wish! Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment