title: Can't close mail view controller when clicking Cancel, Save Draft or Delete Draft
body: <p>I'm implementing a mail controller in my app but I can't figure out why it won't close when clicking save draft or delete draft. The window gets stuck on the email screen and I can't click "Cancel" a second time either.</p>
  
  <pre><code>@IBAction func emailButtonTapped(_ sender: UIButton) {
      guard MFMailComposeViewController.canSendMail() else {
          if !MFMailComposeViewController.canSendMail() {
              print("Can not send email")
              return
          }
          return
      }
  
  
      func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
          dismiss(animated: true, completion: nil)
      }
  
      let mailComposer = MFMailComposeViewController()
      mailComposer.mailComposeDelegate = self
  
      mailComposer.setToRecipients(["example@example.com"])
      mailComposer.setSubject("Look at this")
      mailComposer.setMessageBody("Hello, this is an email from the app I made.", isHTML: false)
  
      present(mailComposer, animated: true, completion: nil)
  }
  </code></pre>