I have a view controller Athat shows the status bar on top. From this view controller, I want to present another view controller Bthat hides the status bar. To achieve this, I redefine the property
override var prefersStatusBarHidden: Bool {
return true
}
on B. To ensure smooth animation whenever the status bar (dis) appears, I also override the property
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
return .slide
}
However, when I now present the view controller Bfrom A, the status bar disappears abruptly and Ais still visible, right before the start of the animated modal transition.
I am looking for a way to fix this "transition status bar" behavior . Ideally, I would like to have a clean separation:
A: shows the status barB: does not show the status bar
so when i present the Bstatus bar is covered by it.
Since the status bar appears to be a global view that does not belong to any particular controller, it is probably difficult for it to achieve this behavior. Therefore, if it is not possible to reproduce this exact behavior of the animation, I would also be glad if the status bar would slide smoothly during the transition of the view controller. How can i achieve this?