How can I had the status bar whenever the view is scrolling with:
self.navigationController?.hidesBarsOnSwipe = true
or if not hide the status bar, how can I keep my status bar from overlaying my view?
ty awesome stackoverflow community
A Swift 3 elegant solution:
open override var prefersStatusBarHidden: Bool {
return navigationController?.isNavigationBarHidden ?? false
}
Sorry if this answer is a little late, but here is one way to do it.
Use the prefersStatusBarHidden() method within your view controller.
override func prefersStatusBarHidden() -> Bool {
if self.navigationController?.navigationBarHidden == true {
return true
} else {
return false
}
}
Basically says that when the Nav bar is hidden, then the status bar is too and vice versa.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With