I am trying to change the default backBarButtonItem colour to white colour,
my codes look like below
self.navigationItem.backBarButtonItem?.tintColor = UIColor.whiteColor()
But It is not working for me, any ideas?
If you want to change the backBarButton do this :
override func viewDidLoad() {
super.viewDidLoad()
let newBackButton = UIBarButtonItem(title: "B",
style: UIBarButtonItem.Style.plain, target: self, action: "backAction")
navigationController?.navigationBar.topItem?.backBarButtonItem = newBackButton
newBackButton.tintColor = .red
// Do any additional setup after loading the view.
}
func backAction() -> Void {
self.navigationController?.popViewController(animated: true)
}