I have a very strange behavior:
I have an app with navigation controller (navigation bar) where status bar is visible. Then I present a view controller (barcode scanner using camera) modally where I want to hide the status bar, so I implemented:
override func prefersStatusBarHidden() -> Bool {
return true
}
When I close the modally presented view using
self.dismissViewControllerAnimated(true, completion: nil)
the view disappears and the status bar keeps hidden, although the rootviewcontroller implements
override func prefersStatusBarHidden() -> Bool {
return false
}
But after some seconds the status bar appears automatically!?
I a solution here at StackOverflow which I tried:
UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: UIStatusBarAnimation.Fade)
self.dismissViewControllerAnimated(true, completion: nil)
But this doesn't changed anything for me.
Maybe I can make a refresh in the rootview in viewDidAppear??
setNeedsStatusBarAppearanceUpdate
? – jrturton