I've tried to call ignoreSnapshotOnNextApplicationLaunch
in every possible methods and it still seems broken to me.
Instead, I ended up using a fake launch image to prevent user from seeing the real App content:
- (void)applicationWillResignActive:(UIApplication *)application {
// This line doesn't seem to work...
// [application ignoreSnapshotOnNextApplicationLaunch];
self.appCover = [[UIImageView alloc] initWithFrame:[self.window frame]];
// setup a little in order to make our fake looks better
self.appCover.contentMode = UIViewContentModeScaleAspectFit;
self.appCover.backgroundColor = [UIColor whiteColor];
// This is the image we use in our LaunchScreen.xib
[self.appCover setImage:[UIImage imageNamed:@"LaunchImage"]];
[self.window addSubview:self.appCover];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// get rid of the fake launch image after App become active
if (self.appCover) {
[self.appCover removeFromSuperview];
self.appCover = nil;
}
}
Not perfect but works like what ignoreSnapshotOnNextApplicationLaunch
should do.
2019-04-11 UPDATE:
This is pretty embarrassing: turns out my app crashes every time after -[UIApplication terminateWithSuccess]
due to some third party frameworks not being released properly.
So in my case, I just need to release these frameworks correctly in applicationWillTerminate
, and everything works as expected. (don't even need the ignoreSnapshotOnNextApplicationLaunch
approach)