ios - 根据参数不同的 Storyboard入口点

标签 ios authentication uiviewcontroller storyboard entry-point

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

我该如何处理?

提前致谢

最佳答案

您可以在应用程序 DidFinishlaunchingWithOptions 方法的 AppDelegate 类中尝试一下吗?不知道这会起作用。这是一种预感。像这样尝试。

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

关于ios - 根据参数不同的 Storyboard入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30704310/

相关文章:

iphone - 您如何为设备和模拟器编译 PJSip iPhone 以在 iOS 3 和 iOS 4 上使用虹吸管?

php - 使用 PHP 登录 MySQL - 多久一次?

ios - UIViewController 之间的问题切换

ios - PhotoPicker 示例应用程序,MyViewController

swift - 警告 : Attempt to present ViewController on ViewController which is already presenting ViewController

objective-c - NSURLConnection 成功后重新加载 TableView

ios - 来自 Google Maps SDK for iOS 的街景?

authentication - HTTP Auth over SSL 安全吗?

ios - 如果使用链接的人下载了应用程序,我的 swift 应用程序是否可以链接到应用程序商店并将信息传递给应用程序?

azure - 如何通过组织帐户或 Active Directory 访问 Azure Server