如何保持启动画面,直到应用程序委托中的过程结束? [英] How to hold splashscreen until process in app delegate is over?

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

问题描述

在应用程序委托中,我放置了一些功能,我希望启动屏幕一直等到appdelegate完成其功能.现在,我的应用程序立即同时运行初始视图控制器功能和应用程序委托功能.

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.

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆