i have a feedback button in my ios 7 application with MFMailComposeViewController. After the user click this button the mailcomposer open but the statusbar changed to black.
Solution for Swift3
Add this to your ViewController:
extension MFMailComposeViewController {
open override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
open override var childViewControllerForStatusBarStyle: UIViewController? {
return nil
}
}
Set View controller-based status bar appearance >> YES as below:
Thanks to @SoftDesigner
Another cleaner solution that may not change other settings in your app. While presenting the Mail VC change the status bar in the completion block:
controller.present(mailComposeViewController, animated: true) {
UIApplication.shared.statusBarStyle = .lightContent
}