How to hold splashscreen until process in app delegate is over?

五迷三道 提交于 2019-12-22 10:28:32

问题


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?


回答1:


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.




回答2:


You can't hold the splash screen for more than expected natively. You could show a similar view controller after the splash screen, but only if you manage a lot of data and you need a loading screen. Holding the splash screen is also prohibited from the Apple App Store guidelines.



来源:https://stackoverflow.com/questions/35803339/how-to-hold-splashscreen-until-process-in-app-delegate-is-over

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!