What happens during the iOS Splash Screen?
When you start an iOS App, you often see the Splash Screen, or Launch Image.
Which of the initialization steps happen during this screen?
What can you control during this phase?
How can you shorten the time the screen is displayed?
Our app takes a long time to load (especially the first time). Ideally I'd like to put some kind of progress bar instead of a static image...
The launch screen is show when iOS loads you app into memory. There is nothing you can control will this is happening.
After loading the int main(int argc, char *argv[])
is called in your main.m
, this will load an UIApplication
and set your appdelegate as its delegate. After which - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
is called and you have control over what happens from this point on.
The launch screen will be removed as soon as you return YES
form -application:didFinishLaunchingWithOptions:
.
If your app is taking a long time to load, you should exit form -application:didFinishLaunchingWithOptions:
as soon as possible, any resource that need to be load you could dispatch in a queue running in the background this way your app will become active sooner and load data without block any UI thread.
系统需要在此期间加载主视图,以缩短时间,请尽可能少地在didFinishLaunchingWithOptions
,以便您的第一个视图控制器尽快显示,然后在第一个屏幕上显示渐进视图
上一篇: Android异步启动屏幕不显示内容视图