It has been some time since I have worked on an iOS project and am struggling with what is likely a fairly basic concept to do with UINavigationController
s.
I have the following setup in my storyboard:
- Navigation Controller
- View 1: Login View (Root)
- View 2: Register View
- View 3: Verification View
My project flow requires that, after a user registers an account in the Register View, they be taken to the Verification View. My project flow also requires that I show the Verification View if the user logs in from the Root View and they have not verified their email address.
It is important that if the user presses back in the Verification View that they are always taken to the Login (Root) view, never the register view.
I have reviewed the following questions:
- Navigation Controller Push View Controller
- UINavigationController pushViewController in viewDidLoad not working
As well as many others and not found a good rule of thumb for situations like this. I expect the best course of action would be to return from the Register View (Pop) to the Root view and then tell the Root view to move to the Verification View using a segue but [self parentViewController]
in the Register view seems to give me the UINavigationController.
My question is this: What is the correct flow to use here?