When developing for iOS from time to time, customers, and some programmers, also have a logical question: “Is it possible to replace the image in some way when the application starts?”.
Having a little searching on the Internet, and having rummaged in
documentation , the answer arises that it is impossible to make it for the following reasons:
- The file that is displayed when the application is started is inside the application folder, and, therefore, it is not possible to rewrite it.
- For a similar reason, you cannot change the Info.plist file, which stores the relative path to the file with the start image.
However, it is still possible to do this in standard ways, without any kind of Jailbreak. However, as with each solution has its advantages, disadvantages and features.
')
Decision
Since we cannot change anything inside the folder with the application, we will not even try. It is possible that there are craftsmen who can do it, but now it’s not about them.
So, we will place Default.png in the Documents folder.

Now, assuming that Default.png is located in this folder, put the relative path in Info.plist:

Voila! We start. Everything is working.
Hm Suppose if everything is clear with the relative path to the Default.png file, how can we put Default.png in the Documents folder?
Programmatically. When you first start the program, it must be copied from the same Bundle. In fact, there are already a couple of options here - download Default.png from the Internet, generate it on the fly, insert the photo you just shot instead of Default.png. It all depends on the specifics of the application.
For example, it might look like this:
// Documents
NSArray* dirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsPath = [dirs objectAtIndex:0];
NSString * splashDest = [documentsPath stringByAppendingPathComponent:@"Splash.png"];
NSString * splashSrc = [[NSBundle mainBundle] pathForResource:@"Splash" ofType:@"png"];
// Splash.png
NSFileManager * fm = [NSFileManager defaultManager];
[fm copyItemAtPath:splashSrc toPath:splashDest error:nil];
The peculiarity (main disadvantage) of this method is that the splash will not be visible at the first boot, since
There is no possibility until it was found that when installing the application it was possible to write something into the Documents folder.
PS Formally, this method
does not violate the
HIG violates, namely: ...
All launch images of your application's bundle directory ... and ...
When launching an application image on the screen ...
So, the use of this method in the App-Store is a big question.
In addition, it is not entirely clear how this method will work if the application is localized.
But, if all of the above you are satisfied, then you can safely use this method.