I want to hide the status bar after calling UIImagePickerController on iOS 10.2.
There are several questions with answers that don't work for Swift 3.0.
The suggested answers are:
So I tried:
extension UINavigationController{
open override var prefersStatusBarHidden: Bool{
return true
}
}
So I tried:
extension UIImagePickerController{
open override var prefersStatusBarHidden: Bool{
return true
}
}
So I tried:
class MyImagePickerController: UIImagePickerController{
override var prefersStatusBarHidden: Bool{
return true
}
}
None of the above solutions work for me.
The status bar can be permanently hidden with the following extension to UIImagePickerController
:
extension UIImagePickerController {
open override var childViewControllerForStatusBarHidden: UIViewController? {
return nil
}
open override var prefersStatusBarHidden: Bool {
return true
}
}
This is working for Swift 3, on iOS 10.
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