From 22877c80120ecebea2d8b199b43c078cd443634b Mon Sep 17 00:00:00 2001 From: Yishi Lin Date: Thu, 4 May 2017 21:12:37 +0800 Subject: [PATCH] Show and copy developer email if failed to open the Mail App --- pass/Controllers/BasicStaticTableViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pass/Controllers/BasicStaticTableViewController.swift b/pass/Controllers/BasicStaticTableViewController.swift index a0d7536..6e975ee 100644 --- a/pass/Controllers/BasicStaticTableViewController.swift +++ b/pass/Controllers/BasicStaticTableViewController.swift @@ -98,6 +98,12 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo let subject = urlComponents.queryItems![0].value ?? "" if MFMailComposeViewController.canSendMail() { sendEmail(toRecipients: [urlComponents.path], subject: subject) + } else { + let email = urlComponents.path + let alertTitle = "Cannot open Mail App" + let alertMessage = "Email copied: \(email)" + Utils.copyToPasteboard(textToCopy: email) + Utils.alert(title: alertTitle, message: alertMessage, controller: self, completion: nil) } case "http", "https": let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)