Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the launch image of an app on every launch

I want to change the launch image of my app each time I open it. I've searched on Google and I've found two approaches:

  1. Set my launch image name in the plist config file, and replace the image file each time.

  2. Delete the launch image property in the plist each time the app launches, display another imageview or uiview, and change the image of the imageview;

The first way, some people said that Apple might reject the app or it may not be approved. Is this likely to be the case?

The second way, it takes a long time after my app is configured and loaded and the app displays a black screen during the loading itself.

like image 494
yudun1989 Avatar asked Jun 04 '13 08:06

yudun1989


People also ask

How do I change my Launch Screen?

Choose File > New > File. Under User Interface, select Launch Screen, and click Next. Give the launch screen file a name, choose a location, select the target that you want to add the file to, and click Create. In the settings for your target, select the General tab and find the “App Icons and Launch Images” section.

What is Launch Screen storyboard?

The LaunchScreen. storyboard is an interface builder storyboard file that uses auto-layout and some basic constraints on the controls to adjust the display for all the supported devices. Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.

How do I splash screen in iOS?

iOS comes with a built-in function called launch image. This image is automatically displayed when user opens the app and disappeared until the app is fully ready to use. You can simply specify your splash screen as launch image in Xcode and it will handle the rest for you.


2 Answers

I'd recommend you to do this in code, aka display a "virtual" launch screen of your own using UIImageView.

What you want to achieve is impossible, ipas (and thus their contents, including Info.plist) are signed when you archive your app. That means that any modification you make will break the signature, and so you'd need to resign it to make it executable again. The only way to achieve this is to sign your contents again and submit the app to the AppStore once more which kinda invalidates your argument.

Go for the UIImageView approach, I know it won't look that nice but it's the closest you can get given the constraints Apple's ecosystem imposes.

like image 103
Alejandro Benito-Santos Avatar answered Oct 01 '22 10:10

Alejandro Benito-Santos


The simple answer is NO you are not allowed to do this. This is because the image that you would have to modify is Default.png which is the launch image name which is located in the main bundle of the project, and it is not allowed to edit/amend/modify files in the main bundle of an iOS project.

This is because the contents of the main bundle are cryptographically (Think that's how it's spelt) signed as part of the Apple App store submission. So in modifying the contents within the main bundle could cause the application to stop running.

This also goes against the Apple submission guidelines.

Also Whilst some have suggested doing it through code with animation after it launches you will still need a launch image as it is part of the apple human interface guidelines. All apps must have a launch image.

The only time that you can have different launch images is when your basing it on device and/or retina display and/or orientation.

Here are some of the ones you can use.

Default.png
[email protected]
Default-568h.png or [email protected]
Default-Portait.png
[email protected]
Default~ipad.png
Default-Portait~ipad.png
Default@2x~ipad.png
etc
like image 36
Popeye Avatar answered Oct 01 '22 10:10

Popeye