Я хотел бы немедленно ПОСЛЕ ТОГО, КАК я нажимаю всплывающее окно отправки или отмены своей электронной почты, чтобы отобразить контроллер предупреждений, показывающий, было ли отправлено мое письмо, мне удалось показать контроллер предупреждений только ДО отправки сообщения, но не ПОСЛЕ ...:
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
switch result {
case .cancelled:
let alertController = UIAlertController.init(title: "Cancelled", message: "Send Email has been cancelled", preferredStyle: .alert)
alertController.addAction(UIAlertAction.init(title: "Ok", style: .default, handler: { (alertAction) in
controller.dismiss(animated: true, completion: nil)
}))
controller.present(alertController, animated: true, completion: nil)
case .sent:
let alertController = UIAlertController.init(title: "Sent", message: "Message Sent Successfully", preferredStyle: .alert)
alertController.addAction(UIAlertAction.init(title: "Ok", style: .default, handler: { (alertAction) in
controller.dismiss(animated: true, completion: nil)
}))
default:
break;
}
это то, что я пробовал