How can I change the font of the back button for my navigation bar.
The back button is either \"back\" or the title from the previous view controller.
I tho
When you are sure you've already set a UIBarButtonItem
you can do:
self.navigationItem.leftBarButtonItem!.title = "myTitle"
To change e.g. the color you can do the following:
self.navigationItem.leftBarButtonItem!.tintColor = UIColor.redColor()
When you haven't set it in your storyboard you can do:
self.navigationItem.leftBarButtonItem = UIBarButtonItem()
For changing the font, do the following:
self.navigationItem.leftBarButtonItem!.setTitleTextAttributes([NSFontAttributeName: UIFont(name: "FONTNAME", size: 20)!], forState: .Normal)
Maybe I should mention that you mustn't use self.navigationController
because when setting the navigationController's buttons they aren't displayed on the screen so as a result the buttons which are on the screen and had been set in the storyboard have to be self.navigationItem
...