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:
Set my launch image name in the plist config file, and replace the image file each time.
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.
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With