Create Navigation controller class as below. Assign this "CustomNavViewController" to UINavigationController in your StoryBoard
class CustomNavViewController: UINavigationController,UINavigationControllerDelegate
{
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func navigationController(
_ navigationController: UINavigationController,
willShow viewController: UIViewController,
animated: Bool
) {
viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: " ", style: .plain, target: nil, action: nil)
}
}
So, no need to do it in every viewControllers.
At last remove below line from AppDelegate class if present,
UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), for:UIBarMetrics.default)