When I present the ImagePickerController the statusBar text color is still bla
Swift solution by writing an extension for UIImagePickerController:
extension UIImagePickerController {
convenience init(navigationBarStyle: UIBarStyle) {
self.init()
self.navigationBar.barStyle = navigationBarStyle
}
}
Then you can set the color when initializing it:
let picker = UIImagePickerController(navigationBarStyle: .black) // black bar -> white text
Alternative (inspired by folse's answer): When you initialize the UIImagePickerController normally, make this class the delegate (picker.delegate = self
) and implement this function:
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if navigationController is UIImagePickerController { // check just to be safe
navigationController.navigationBar.barStyle = .black // black bar -> white text
}
}