0
votes

I know this is bad UX, however a client has requested that I display a splash screen for 2 seconds every time the user opens the app.

I have tried implementing this through the AppDelegate by:

  • Creating an instance variable of the splash screens view controller in the application:didFinishLaunchingWithOptions: method, and settings the alpha of its view to 0.

  • Then in applicationWillEnterForeground: I set the alpha to 1 in the hope that the splash screen will show every time the user opens the app, then set the alpha back to 0 after 2 seconds.

Now, this does work, however not properly. When the app opens the main UI is shown momentarily then the splash screen is shown.

Of course this is not what is intended as the splash screen should be shown before the main UI.

I am trying to persuade the client to do away with this, however does anyone know how it can be implemented properly (in case they are totally adamant that they want it)?

From application:didFinishLaunchingWithOptions:

_tabBarController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"TabBarController"];
[[self window] setRootViewController:_tabBarController];
[_tabBarController setDelegate:self];


_loadingViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoadingView"];
[[_loadingViewController view] setAlpha:0.0f];
[_loadingViewController willMoveToParentViewController:_tabBarController];
[_tabBarController addChildViewController:_loadingViewController];
[_loadingViewController didMoveToParentViewController:_tabBarController];
[[_tabBarController view] addSubview:_loadingViewController.view];

From applicationWillEnterForeground:

[[_loadingViewController view] setAlpha:1.0f];

[self performSelector:@selector(removeLoadingView) withObject:nil afterDelay:2.0];
1
Well you have the default launch images anyway is this not enough for your client? - Popeye
Your app should it return to it's previous state after going to background and returning to active? - Popeye
Believe me, I have tried, however they are adamant that they want the user to see the splash screen every time they open the app. - Nick
To be honest you could just show them the Apple Human Interface Guidelines around splashscreens and then the Apple review rules that state that Apps have to abide to these guidelines or they will be rejected because that is totally true. There is your argument to get the client to change there mind if they want it in the actual app store they will not be able to have it, simple. I've had loads of disagreements with clients but as soon as you show them the Apple guidelines they drop it because they want a to appear in the store. - Popeye
Also show some code please. - Popeye

1 Answers

0
votes

This is a workaround but you can always try :

Put a UIImageView on the root view controller. (or create a new one with the splash screen image) Once the real splash is removed, this view will displayed then you can remove it after with the effect of your choice.