不同故事板的入口点取决于参数

Different storyboard's entry points depending on a parameter

我正在开发一个应用程序,我需要在其中管理用户必须提供凭据才能登录和访问主应用程序功能的常见情况。这样,如果用户未登录,我需要首先显示的视图是允许她登录的视图,或者如果用户在应用程序时已经登录,我们将其称为应用程序的 "dashboard"已启动。

我该如何处理?

提前致谢

你能在 AppDelegate class 的应用程序 DidFinishlaunchingWithOptions 方法中试试这个吗?不知道这会起作用。这是一种预感。像这样尝试。

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