UINavigationController skipping a pop
I have 3 view controllers, one is the root, which pushes the next, which pushes the next. Each time you can go back (pop), using the normal back button that appears by d开发者_如何转开发efault.
However when the 3rd view is visible, when the user taps the back button I need it to skip out the the 2nd view controller, and go (pop) directly to the root view controller.
How can I override the default back button behaviour? (I'd like to keep the shape of the back button, and not replace it with a square bar button)
You could try to have an object implement UINavigationControllerDelegate and enforce this behavior. You could also have a designer create the same size and shape asset and you could use this as the background for a button. However, I'd rethink your UI if you really need to do this. It is contrary to the user's expectations of how a navigation controller should work.
精彩评论