I am pushing from a viewController to another instance of the same viewController using the following code. The viewController is the top view of the navigation stack in the storyboard:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if let vc2 = storyboard.instantiateViewController(withIdentifier: "MyViewController") as? MyViewController {
self.navigationController?.pushViewController(vc2, animated: true)
}
When vc2 is pushed to for a moment the back left arrow and title of the backButton is visible but the arrow quickly disappears and only the title is left for the backButton.
I'm assuming that this is because the instantiated viewController is the topViewController in the storyboard.
I tried:
self.navigationItem.hidesBackButton = false
but this didn't work. Not sure how to make the back arrow (carat) be visible in this case. The backButton title continues to be displayed and pressing it correctly returns to the previous view.
just try this
self.navigationItem.leftBarButtonItem = nil
If it doesn't work then check appearance color of navigation