I need to customise the look of a back button in a Swift project.
Here\'s what I have:
Here\'s what I want:
I\'ve tried creating my own UIBarButtonItem
This worked for me on iOS 13 using swift 5. Just hide the original back button and add a new navigation left bar button item with an action.
navigationItem.hidesBackButton = true
navigationItem.leftBarButtonItem = UIBarButtonItem(image: #imageLiteral(resourceName: "backBtn"), style: .plain, target: self, action: #selector(back(sender:)))
@objc func back(sender: UIBarButtonItem) {
self.navigationController?.popViewController(animated:true)
}