Therefore, if I am on the screen, I can go to the next navigation screen using pushViewController, and I just go to the next screen using the backButton on the previous screen.
Is the previous screen used (the screen on which the back button is pressed) ... does it have a name? (Like the previous control), something like this)
My goal behind this question is:
If I have 5 screens (1, 2, 3, 4, 5 respectively) ... let's say I move from 1 → 3, and in another case I move from 2 → 3. I want to say that if "Previous ViewController was 1 ", then go from 3 to 4 (1 → 3 → 4), otherwise, if the previous ViewController was 2, I want to go to 3 - 5 (2 → 3 → 5) ...
How can I do something like this?
Thank!
ps I know that I could also try something sensible and logical with a different approach and just pushViewController accordingly. But if there is a solution for checking the previous ViewController, it will facilitate my task and become a great learning experience.
source
share