元の画面に戻る際の処理をしたいのですが
下書き保存・下書き削除では元の画面に戻る事ができますが何故かキャンセルでは元の画面に戻ることが出来ません。
原因がわかる方いらっしゃいますでしょうか。
宜しければご回答宜しくお願いいたします。
if MFMailComposeViewController.canSendMail() { let mail = MFMailComposeViewController() mail.mailComposeDelegate = self mail.setToRecipients(["test1@gmail.com"]) mail.setSubject("件名") mail.setMessageBody("お問い合わせ内容はこちらに記載をお願い致します。", isHTML: false) self.present(mail, animated: true, completion: nil) } else { //アラートで通知 let alert = UIAlertController(title: "No Mail Accounts", message: "Please set up mail accounts", preferredStyle: .alert) let dismiss = UIAlertAction(title: "OK", style: .cancel, handler: nil) alert.addAction(dismiss) self.present(alert, animated: true, completion: nil) } } func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { if error != nil { //送信失敗 print("Error") } else { switch result { case.cancelled: break //キャンセル case.saved: break //下書き保存 case.sent: break //送信 default:break } controller.dismiss(animated: true, completion: nil) } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/22 16:08