Wow, that's kind of disappointing about WKWebView.
Personally I think this a bug not a feature. In-app email, as implemented by the MessageUI framework, is a lot nicer than just bouncing out to Mail. However, if you want to bounce out to mail, you can do that by call
openURL(_:)
on UIApplication (actually it’s successor,
open(_:options:completionHandler:)
).
Can I switch to UIWebView or is that ill advised?
That would be ill advised; while
UIWebView
has not been formally deprecated,
WKWebView
is the future of web views on our platforms.
Tried your code with print statements. Upon clicking the mailto: link, I did not see the print statements. Am I not doing something correctly?
Did you set the navigation delegate on the
WKWebView
? Specifically:
Your view controller should conform to the
WKNavigationDelegate
protocolWhen your view controller creates the web view, it should set the
navigationDelegate
property to self
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"