MFMailComposeViewController

Has anyone tried to use a MFMailComposeViewController in the expanded mode to send an email?? When I do so, the controller seems to constrain itself to the top of the view instead of the LayoutGuide.bottomAnchor and so the cancel/send buttons are hidden. I tried to set constraints on the controller but they are apparently ignored.


Any thoughts/workarounds or am I just approaching this all wrong??


if MFMailComposeViewController.canSendMail() {

let mail = MFMailComposeViewController()

mail.mailComposeDelegate = self

mail.setToRecipients(["awesomecoder@me.com"])

mail.setSubject("Yeah, really!")

mail.setMessageBody("Whatever, dude!", isHTML: true)


mail.view.translatesAutoresizingMaskIntoConstraints = false

mail.view.topAnchor.constraint(equalTo: self.topLayoutGuide.bottomAnchor).isActive = true


present(mail, animated: true, completion: nil)

} else {

}

MFMailComposeViewController
 
 
Q