I have a configurationControllerVC
and loginPageControllerVC
. Initially I want to present the configurationControllerVC
. Once my configuration procedure is completed, I go to the loginControllerVC
. If the configuration is already done and the user re-opens the app I want to load the loginControllerVC
straight away without having to go through the configuration procedure.
The problem is that in my application, there is one condition and if it is false I want to take the user back to configurationControllerVC
.
My flow of viewControllers is as below:
If configuration is not yet Done:
ConfigurationControllerVC --> LoginControllerVC --> HomePageControllerVC --> ReportingControllerVC.
If Configuration is done then the flow is this:
LoginControllerVC --> HomePageControllerVC --> ReportingControllerVC.
The condition on which I want to navigate the user to configurationControllerVC
may be encountered on HomePageControllerVC
or reportingControllerVC
.
In such a case what is better? Using a UINavigationController
or just presenting the Views one above the other? Also, how do I achieve this part of navigating the user back to configurationControllerVC
?
Currently I am using this code to present the configurationControllerVC
and LoginControllerVC
in my appDelegate
.
if ([self checkForConfiguration]) {
// Initiate initial screen
ConfigurationController *configurationController = [[ConfigurationController alloc] initWithNibName:@"ConfigurationPage"
bundle:nil];
[self.window setRootViewController:configurationController];
}else{
LoginController *loginController = [[LoginController alloc] initWithNibName:@"LoginPage" bundle:nil];
[self.window setRootViewController:loginController];
}
Have seen these links but neither are working in my case: