Question

I understand, Its a HIG violation to play around with the default launch icons and splash screens, but I have requirement such that, I need to display the splash screen only for the first time, Is it possible to implement it ? One simple solution, I can think of is : displaying as an imageView on top of UIwindow and then removing it based on a timer. Am looking for other options.

Was it helpful?

Solution

My advice is to rework your view hierarchy so that the first view mimics the splash screen you wish to show (A view controller with a uiimage embedded should work fine for what you've described). Then push the "main screen" over top of that view after your specific period of time. A little code to ensure that this happens only on the first run with some persistent storage and you should be good to go.

I do not advise working with UIWindow directly. Doing so can lead to all sorts of headaches.

OTHER TIPS

That is to simple.

But you aren't need to manipulate the launch image, but an image loaded by your app. To prevent to launch the second time you can set a flag in the internal storage.

Make sure to use a lazy load / initalization technique and display the image fast as much is possible, than do the initializations.

I hope it helps!

If you use iOS6, you can use restoration feature. At first run your app will show launch image. All other runs it'll show last state screenshot.

So you know its a HIG violation but looking for some workaround. You have to have a launch image while uploading the app and showing on first launch. I assume you dont care about app review in appstore.

Lets think

Launch image has to be in main bundle. And the main bundle is readonly for your code. I have some workaround but it may work only for second time launch to show the launch image and then no again.

  1. Add your launch image with any name

  2. Add a symlink to your app bundle with name Default.png, which shows the file in 3. step

  3. Copy that launch image to your app directory folder (your symlink in app bundle shows the file) on first launch.

  4. Launch second time the app and see the launch image

  5. Delete the copied image.

When your app can not find a png file which showed by your symlink it can not show launch image

PS: Personally I did not try that but may work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top