With Defold 1.2.163 the launch screen/image was effective, there was no gap between the launch screen/image and the app content.
With Defold 1.2.164 there is a short period of time with black screen, which gets longer depending on the loading time of the app.
This results in a black flash when launching an app, which is not pleasant to the eye.
Hmm, apart from changing to using the UIApplicationMain, I donât know what could have caused this.
Although launchimages are deprecated, so we should probably look into supporting a launch story board.
The recommendation is to have a tiny bootstrap collection that launches extremely quickly and then use collection proxies to load the bulk of your content. This should minimize/remove the chance to see a black screen while the bootsrap collection is loading.
Thank you for the quick answers! But even with the tiniest app and the right clear colors I can see a black flash. And worse, it appears that if the app is loaded âcoldâ iOS does a âniceâ crossfade between launch screen and app, resulting in a slightly longer black screen. Not sure if that is what happens, but that is what it appears like.
So after some digging and talking to chatGPT about possible fixes I ended on the following solution: in the didFinishLaunchingWithOptions method in AppDelegate, load the launch screen storyboard and put it front like so:
// Load the LaunchScreen storyboard
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *launchScreenVC = [storyboard instantiateInitialViewController];
UIView *launchScreenView = launchScreenVC.view;
// Add the launch screen view as a placeholder
launchScreenView.frame = self.window.bounds;
launchScreenView.tag = 999; // Set a tag to identify the view later
[self.window addSubview:launchScreenView];
[self.window bringSubviewToFront:launchScreenView];
[self.window makeKeyAndVisible];
Then remove this UIView in the appUpdate method
// Cleanup the placeholder view once the engine is initialized
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
dispatch_async(dispatch_get_main_queue(), ^{
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UIView *viewToRemove = [window viewWithTag:999];
[viewToRemove removeFromSuperview];
});
});
Currently I have this working through a native extension by using method swizzling and it looks much smoother. I could make the changes to the engine myself and put in a pull request, however I donât know how to access the Launch Screen setting in the editor so that it correctly loads the launch screen set by the user.