I want to customize MFMailComposeViewController style and its behaviour in my app, but all my attempts fail. I tried several ways: First way:
let mailComposeViewController = MFMailComposeViewController()
...
UINavigationBar.appearance().tintColor = UIColor.red //don't see changes
UINavigationBar.appearance().barTintColor = UIColor.green //don't see changes
UINavigationBar.appearance().backgroundColor = UIColor.yellow //don't see changes
UINavigationBar.appearance().isTranslucent = false //don't see changes
UINavigationBar.appearance().clipsToBounds = false //don't see changes
UINavigationBar.appearance().prefersLargeTitles = false //don't see changes
present(mailComposeViewController, animated: true, completion: nil)
Second way:
extension MFMailComposeViewController {
open override func viewDidLoad() {
super.viewDidLoad()
self.navigationBar.clipsToBounds = true //don't see changes
self.navigationBar.prefersLargeTitles = false //don't see changes
self.navigationBar.isTranslucent = false //don't see changes
self.navigationBar.barTintColor = UIColor.green //don't see changes
self.navigationBar.tintColor = UIColor.red //only this works!
}
}
PS What I'm most interested in is changing the prefersLargeTitles to false or change navigationBarStyle like here :
My result:


From Apple:
I think Apple does not approve of your code on the Second way, you're not supposed to modify this view. However, Try: