I want to remove the title and use only custom image for back button in Navigation Controller. I came across questions like this and I have tried this:
navigationItem.backBarButtonItem = UIBarButtonItem(image: UIImage(named: Constants.Image.kClose), style: .plain, target: nil, action: nil)
I am putting this in viewDidLoad()
of the View Controller which is pushing a UITabbarController
. ( I know its not a very good idea to push Tab Bar in a Navigation Controller, but I need to do this).
I am getting the following result:
But I don't want that default blue back button. I just want my custom close button to appear there. How can I achieve this?