commit
4625805fba
|
@ -15,4 +15,13 @@ extension URL {
|
|||
scheme == "mailto" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil
|
||||
}
|
||||
|
||||
func valueFor(_ parameter: String) -> String? {
|
||||
guard let components = URLComponents(url: self, resolvingAgainstBaseURL: false),
|
||||
let queryItems = components.queryItems,
|
||||
let value = queryItems.first(where: { $0.name == parameter })?.value else {
|
||||
return nil
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -338,6 +338,7 @@ extension WebViewController: WKNavigationDelegate {
|
|||
if MFMailComposeViewController.canSendMail() {
|
||||
let mailComposeViewController = MFMailComposeViewController()
|
||||
mailComposeViewController.setToRecipients([emailAddress])
|
||||
mailComposeViewController.setSubject(url.valueFor("subject") ?? "")
|
||||
mailComposeViewController.mailComposeDelegate = self
|
||||
self.present(mailComposeViewController, animated: true, completion: {})
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue