Check mail service is ready before open VC
This commit is contained in:
parent
48d1ab34d2
commit
36e2a96df2
1 changed files with 3 additions and 1 deletions
|
|
@ -92,7 +92,9 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo
|
||||||
case "mailto":
|
case "mailto":
|
||||||
let urlComponents = URLComponents(string: link)!
|
let urlComponents = URLComponents(string: link)!
|
||||||
let subject = urlComponents.queryItems![0].value ?? ""
|
let subject = urlComponents.queryItems![0].value ?? ""
|
||||||
sendEmail(toRecipients: [urlComponents.path], subject: subject)
|
if MFMailComposeViewController.canSendMail() {
|
||||||
|
sendEmail(toRecipients: [urlComponents.path], subject: subject)
|
||||||
|
}
|
||||||
case "http", "https":
|
case "http", "https":
|
||||||
let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
|
let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
|
||||||
self.present(svc, animated: true, completion: nil)
|
self.present(svc, animated: true, completion: nil)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue