1

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

Pedro Borges
  • 1,568
  • 1
  • 14
  • 25
  • 2
    No, but you can use a controller that has just a UIImageView (the same splashscreen image used by the application) that you can use to "simulate" a longer initialization time. I use it in my application and you wont notice the difference. – Marco Pace Oct 07 '14 at 12:25
  • @MarcoPace - that looks good enough to be an answer to me. – Adam Jenkins Oct 07 '14 at 12:38
  • Post it as an answer so I can ask you some details, namely how to find the resource name specific for my device, is it automatic, etc and you'll get the checkmark :) – Pedro Borges Oct 07 '14 at 12:40
  • Posted as an answer, I'll add some details – Marco Pace Oct 07 '14 at 13:47

2 Answers2

2

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.

Sandro Machado
  • 9,921
  • 4
  • 36
  • 57
  • Although the final solution was to put core data initialisation in a synchronised singleton and call it from the AppDelegate blocking application:didFinishLaunchingWithOptions: – Pedro Borges Oct 07 '14 at 14:13
1

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.

Marco Pace
  • 3,820
  • 19
  • 38