try to hide the status bar from a modal view.
already check several methods:
override func prefersStatusBarHidden() -> Bool {
return true
}
with / without self.setNeedsStatusBarAppearanceUpdate()
also
UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .Fade)
but depreciated in iOS 9
this works in fullscreen presentation (modal segue presentation option) but note in over full screen which is my setting.
if you have any idea..
For a non-fullscreen presentation of a View Controller, you need to use the modalPresentationCapturesStatusBarAppearance
property.
e.g.
toViewController.modalTransitionStyle = .coverVertical
toViewController.modalPresentationStyle = .overFullScreen
toViewController.modalPresentationCapturesStatusBarAppearance = true
fromViewController.present(toViewController,
animated: true,
completion: nil)
For a fullscreen presentation of a View Controller, you need to:
modalPresentationStyle
.prefersStatusBarHidden
in the new VCUIViewControllerBasedStatusBarAppearance
value to YESe.g.
toViewController.modalTransitionStyle = .coverVertical
toViewController.modalPresentationStyle = .fullScreen
fromViewController.present(toViewController,
animated: true,
completion: nil)
(Yes, status bar setting in iOS is pitifully bad. It's no wonder Stack Overflow has so many questions on the subject, and so many varied answers.)