webview 內的顯示要照手機本地端語系
In your info.plist you can set a value called CFBundleAllowMixedLocalizations, if you check that everything should be translated to the right localized language.
在 info.plist 新增一個 key 為 true 的 CFBundkeAllowMixedLocalizations
wkwebview add mail to and tel:
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
//add by phenix 處理mail to
if navigationAction.targetFrame == nil {
let url = navigationAction.request.url
if url?.description.range(of: "http://") != nil || url?.description.range(of: "https://") != nil || url?.description.range(of: "mailto:") != nil || url?.description.range(of: "tel:") != nil {
UIApplication.shared.openURL(url!)
return nil
}
}
下略
//pray
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
let urlStr = navigationAction.request.url?.absoluteString
if((urlStr!.contains("2023"))){
中略
}else if(urlStr!.contains("2109")){
中略
}else if(urlStr!.contains("tel:")){
UIApplication.shared.openURL(navigationAction.request.url!)
decisionHandler(.cancel)
}else{
decisionHandler(.allow)
}
}
FacebookCore Swift Compiler Error on Xcode 10
https://stackoverflow.com/questions/52497216/facebookcore-swift-compiler-error-on-xcode-10
WKWebView使用
https://www.jianshu.com/p/c16153ab46e9
留言列表