Search code examples
iosipadsplash-screenuiwindowhig

Show splash screen only once IOS


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.


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.