As of iOS 11, the status bar in my app is misbehaving when I dismiss it. The background of the status bar turns clear while the status bar is being dismissed. It didn't do this in iOS 10.
I've recreated the issue in a very simple application, which I've uploaded on Github: TestStatusBarBug. Here is all of the relevant code:
AppDelegate.m
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UINavigationBar appearance] setBarTintColor:[UIColor grayColor]];
return YES;
}
@end
ViewController.m
#import "ViewController.h"
@interface ViewController () {
BOOL _statusBarHidden;
}
@end
@implementation ViewController
-(BOOL)prefersStatusBarHidden
{
return _statusBarHidden;
}
-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation
{
return UIStatusBarAnimationSlide;
}
- (IBAction)toggleStatusBar {
_statusBarHidden = !_statusBarHidden;
[UIView animateWithDuration:0.35 animations:^{
[self setNeedsStatusBarAppearanceUpdate];
}];
}
@end
Has anyone else experienced this issue? Is there a fix or a workaround?