How can I change the title color of UINavigationBar
in MFMailComposeViewController
in iOS 12
?
This is what I am doing:
import MessageUI
extension MFMailComposeViewController {
open override func viewDidLoad() {
super.viewDidLoad()
navigationBar.isTranslucent = false
navigationBar.isOpaque = false
navigationBar.barTintColor = .white
navigationBar.tintColor = .white
navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
}
}
In iOS 10 works:
In iOS 11 works:
In iOS 12 is not working:
init
,viewDidLoad
,viewWillAppear
, andviewDidAppear
. I've set the window'stintColor
and I've tried setting thetitleTextAttributes
on both the nav bar and theUINavigationBar appearance
proxy. Nothing has changed the title in iOS 12. I've even dumped the view hierarchy and there's no sign of a nav bar. But that's true under iOS 10 as well as iOS 12. Time for a bug report to Apple. – MargretmargretalargeTitleTextAttributes
, not just thetitleTextAttributes
. edit: and same for UIAppearance – BlandingUIActivityViewController
and I'm not instantiating aMFMailComposeViewController
– IntransigentlargeTitleTextAttributes
but nothing changed. I don't think large titles are being used anyway. I did file a bug report. Others need to do the same to let Apple know it's affecting lots of people. – MargretmargretaUINavigationBar.appearance(whenContainedInInstancesOf: [MFMailComposeViewController.self]).tintColor = .white
– Stated