I have a very strange behavior:
I have an application with a navigation controller (navigation bar) where the status bar is displayed. Then I present a view controller (barcode scanner using the camera) where I want to hide the status bar, so I implemented:
override func prefersStatusBarHidden() -> Bool { return true }
When I close a modal view with
self.dismissViewControllerAnimated(true, completion: nil)
the view disappears and the status bar is hidden, although the rootviewcontroller implements
override func prefersStatusBarHidden() -> Bool { return false }
But after a few seconds, the status bar will appear automatically !?
I have a solution here in StackOverflow that I tried:
UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: UIStatusBarAnimation.Fade) self.dismissViewControllerAnimated(true, completion: nil)
But that didnβt change anything for me.
Maybe I can do an update in the root view in viewDidAppear ??
source share