iosswiftnavigationmfmailcomposeviewcontroller

Issue with MFMailComposeViewController bar button colour


I am facing an issue with MFMailComposeViewController when Increase Contrast is on from Display & Text Size settings. MFMailComposeViewController's Back and Send buttons are not visible when Increase Contrast is on and I am opening MFMailComposeViewController in full-screen mode, if I open that as popover it is visible. I have attached screenshots and code for reference.

enter image description here

if MFMailComposeViewController.canSendMail() {
            let composer = MFMailComposeViewController()
            composer.mailComposeDelegate = self
            composer.setSubject("activityType")
            composer.setToRecipients(["test@gmail.com"])
            composer.setSubject("Sample Subject")
            composer.setMessageBody("<html><body>Sameple Body<br /><br /></body></html>", isHTML: true)
            composer.modalPresentationStyle = .fullScreen
            composer.modalTransitionStyle = .crossDissolve
            self.present(composer, animated: true, completion: nil)
}

Solution

  • I think this is a bug in MessageUI framework. Those buttons are still here, however, their tintColor was changed to transparent. There is a workaround: forcing tintAdjustmentMode when presenting MFMailComposeViewController. You can try it.

    let composer = MFMailComposeViewController()
    composer.view.tintAdjustmentMode = .normal
    ...