Sorry if this answer is a bit late, but here is one way to do it.
Use the prefersStatusBarHidden () method in your view controller.
override func prefersStatusBarHidden() -> Bool {
if self.navigationController?.navigationBarHidden == true {
return true
} else {
return false
}
}
It is basically said that when the Nav panel is hidden, then the status bar is also vice versa.
source
share