Pedro Borges
Pedro Borges

Reputation: 1719

IOS LaunchImage manipulation - can I control the time it stays onscreen?

Is there a way to programmatically define the time the launchImage appears before navigating to storyboard entry point controller?

I would like to be able to exit the splash-screen only after core-data asynchronous load completion block to ensure data availability at my first view controller.

Thanks in advance

Upvotes: 1

Views: 82

Answers (2)

Marco Pace
Marco Pace

Reputation: 3870

No, but you can create a UIViewController that has just a UIImageView (the same splashscreen image used by the application) that you can use to "simulate" a longer initialization time. When data are retrieve, you can simply pop it from the stack and initialize your real UIViewController.

The only problem is to retrieve the correct image from your device: the launch image does it automatically, I suggest to implement a simple methods to choice the correct one so you will avoid any problem.

Here is an answer to detect if you are on iPad, iPhone 4" or iPhone 3,5". You can use it to select the correct image and use it on your UIImageView.

I use it in my applications and you won't notice the difference.

Upvotes: 1

Sandro Machado
Sandro Machado

Reputation: 10205

No you cant. But what you need is to put the code that fetch the results from the core-data in the AppDelegate method - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions and put that synchronous. When the data is available, pass it to your first view controller and continue the execution.

Upvotes: 2

Related Questions