Xero Xero - 5 months ago 18
iOS Question

Back bar button item with right button

I have implemented a right item button in the navigation bar. I use the storyboard, no code. But now the back button is not displayed. What's the good way to show it again without boilerplate code ?

Thank you!

enter image description here
enter image description here

Answer
  • You can not see the back button on the rootViewController of the NavigationController
  • NavigationController automatically add the back button once you push some other ViewController to it.
  • It will display if you have not hides it explicitly.
  • If you have drag and drop the BarButtonItem as shown in the attached image, Just run the code and back button will automatically get added if it was not your RootViewController.
  • If it is RootViewController as displayed in images, try to push some ViewController on it, you will get the back button added.
  • If you add the left bar button item from Interface Builder, you will not get the back button displayed. Then you have to do it manually
Comments