Easier iOS Launch Images

Standard

iOS launch images can drive you a bit mad. For a universal iPhone and iPad app targeting both iOS 6 and 7 you now need 13 different images. It’s tedious. It’s no wonder so many people cheat and use a logo, but that’s against Apple’s Human Interface Guidelines. Oh, and it looks pants.

iOS 7 had the added complication of the status bar being transparent, so you have to include that area in the launch image. Compare the launch image and a screenshot from ScriptTimer

I was going through the laborious process of hiding all labels, taking a screen shot, bunging it in an image editor and removing the status bar. But I’ve got better things to do with my time.

Luckily it’s pretty easy to programatically hide the status bar and any text in the view hierarchy…

  1. Add LaunchImage.cs to your iOS project
  2. Add one line to your AppDelegate:
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
    	...
    
    	#if LAUNCHIMAGE
    		LaunchImage.SayCheese();
    	#endif
    
    	return true;
    }
  3. Add LAUNCHIMAGE as a compilation symbol (Property Options > Compiler in Xamarin Studio):

  4. Launch the app, take a screenshot, and you’ve got a ready-to-go launch image. Tada!

I’ve used a compilation symbol to avoid any chance of App Store rejection, as we’re dicking around with the internals of iOS’s status bar, which will make Apple cry.

Leave a Reply