ios - 如何保持启动画面直到应用程序委托(delegate)中的进程结束?

标签 ios swift splash-screen appdelegate

在 app delegate 中我放了一些 func,我希望启动画面等到 appdelegate 完成它的 func。现在,我的应用程序立即同时运行初始 View Controller 函数和应用程序委托(delegate)函数。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.

    let email = NSUserDefaults.standardUserDefaults().stringForKey("userEmail")
    if let email = email {
       reLogin()
    }else{
        buildNavigationDrawer()
    }// I want this execute first and run the initial view controller's after

    return true
}

如何做到这一点?或者这是关闭初始 View Controller 的一种方式?

最佳答案

在您的应用委托(delegate)完成处理 didFinishLaunchingWithOptoins 之前,无法将启动画面保留在屏幕上。但是,您可以让您的应用程序的第一个 View 与启动图像匹配。然后,当您准备好展示您的内容时,您可以关闭第一个 View 。

关于ios - 如何保持启动画面直到应用程序委托(delegate)中的进程结束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35803339/

相关文章:

ios - 侧面菜单 俯 View

android - 在 react native 应用程序中从 native 基础实现抽屉

ios - UILabel 没有显示更新后的高度?

ios - 为什么旋转应用程序时会在所有 View Controller 中调用 viewWillTransition 方法?

android - android中的 Activity 流程

ios - 找不到 'refs/heads/master'引用错误

swift - 如何在 swift 的 if 语句中使用两个 let 变量

android - phonegap 构建不显示启动画面

ios - 如何在Xamarin iOS项目中无需从设备手动删除App的情况下更新启动画面?

ios - 字典与一堆 "if"和 "return"