ios15 status bar animation when setting a new root view controller in a another orientation

Viewed 270

I change the root view controller this way

window.rootViewController==viewController

The current root view controller is in landscape orientation, and with no status bar :

-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscapeLeft;
}
-(BOOL)shouldAutorotate {
    return YES;
}
-(BOOL)prefersStatusBarHidden{
    return YES;
}
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
    return UIStatusBarAnimationNone;
}

The new root view controller, is in portrait mode, with status bar displayed :

-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutorotate {
    return YES;
}
-(BOOL)prefersStatusBarHidden{
    return NO;
}
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
    return UIStatusBarAnimationNone;
}

I don't want the transition is animated. window.rootViewController==viewController was working fine on iOS14, but since iOS15, when the root view controller is changed, I can see a weird animation of the status bar, transitioning from landscape to portrait. Any ideas how to not show this status bar animation ?

Video thumbnail
Short video of the transition on YouTube

0 Answers
Related