如何在应用程序委托中的进程结束之前保持启动画面

如何在应用程序委托中的进程结束之前保持启动画面

本文介绍了如何在应用程序委托中的进程结束之前保持启动画面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应用程序委托中我放了一些函数,我希望启动画面等待应用程序委托完成它的函数.现在,我的应用立即将初始视图控制器 func 和应用委托 func 一起运行.

In app delegate I put some func, I want the splashscreen waiting till the appdelegate finished its func. Now, my app immediately run initial view controller func and app delegate func together.

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
}

如何做到这一点?或者这是一种关闭初始视图控制器的方法?

How to do this? or is that a way to turn off the initial view controller?

推荐答案

在您的应用委托处理完 didFinishLaunchingWithOptoins 之前,无法将启动画面保留在屏幕上.但是,您可以使应用程序的第一个视图与启动图像相匹配.然后,您可以在准备好显示内容时关闭第一个视图.

There is no way to keep the splash screen on screen until your app delegate is done processing didFinishLaunchingWithOptoins. You could, however, make the first view of your app match the launch image. Then, you can dismiss that first view when you're ready to show your content.

这篇关于如何在应用程序委托中的进程结束之前保持启动画面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 00:15