I've since moved onto Swift and SwiftUI, but when one of my apps was written in Objective-C this is what I used, and it worked every time. Perhaps it's because I'm using a UIImageView?:
- (void)applicationWillResignActive:(UIApplication *)app
{
NSLog(@"AD: applicationWillResignActive");
[self showBlurView:YES];
}
- (void)applicationWillEnterForeground:(UIApplication *)app
{
NSLog(@"AD: applicationWillEnterForeground");
[self showBlurView:NO];
}
- (void)applicationDidBecomeActive:(UIApplication *)app
{
NSLog(@"AD: applicationDidBecomeActive");
[self showBlurView:NO];
}
- (void)showBlurView:(BOOL)show
{
NSLog(@"AD: showBlurView: %@", show ? @"YES" : @"NO");
if(show) {
blurView = [[UIImageView alloc] initWithFrame:self.window.frame];
blurView.image = [UIImage imageNamed:@"blurViewImage"];
[self.window addSubview:blurView];
} else {
if(blurView != nil) {
[blurView removeFromSuperview];
}
}
}
Topic:
UI Frameworks
SubTopic:
UIKit