Different storyboard's entry points depending on a parameter

621 views Asked by At

I'm developing an app where I need to manage the common scenario of users having to provide credentials to log in and access the main app's functions. This way, the view I need to firstly show the user if she's not logged in is the view to allow her to log in, or the let's call it "dashboard" of the app if the user is already logged in when the app is launched.

How could I handle this?

Thanks in advance

1

There are 1 answers

0
iAnurag On BEST ANSWER

can you try this in AppDelegate class in applicationDidFinishlaunchingWithOptions method. Dont know this will work. its a hunch. try like this.

if(userLoggedIn)
{
  window.rootViewController = [window.rootViewController.storyboard   instantiateViewControllerWithIdentifier:@"DashBoardScreen"];
}
else
{
  window.rootViewController = [window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"loginSCreen"];
}