I have 4 views embedded in a Navigation Bar:
VC1 -> VC2 -> VC3 -> VC4
I need Back button from VC3 to be segued to VC1 instead of VC2. I have searched to implement this option but I wasn’t successful. Is it possible?
Many thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t change the behavior of the back button if you want it to keep it’s normal appearance, but you could resort to a dirty fix (I’m not familiar with a better way of doing this) if you can’t organize your application better. It involves editing the navigation stack directly and removing the view controller you don’t need from it.
It’s not a recommended way of handling this, but it gets the things done:
Make sure you get the right index (0 being your rootViewController), and to handle your memory properly.
Probably the best way of going around this is to design the architecture of your application to avoid this kind of behavior completely.