반응형
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
    guard let url = navigationAction.request.url else {
        decisionHandler(.allow)
        return
    }
    
    if ["tel", "mailto", "sms", "facetime"].contains(url.scheme) && UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
        decisionHandler(.cancel)
        return
    }
    
    decisionHandler(.allow)
}

 

2020/05/12 - [iOS/Swift] - WKWebView 스크린샷

2020/05/12 - [iOS/Swift] - json 포멧 체크

2020/05/12 - [iOS/Swift] - Access Control (접근 제한자)

2020/05/12 - [iOS/Swift] - WKWebview에서 tel, email, mailto, sms, facetime 처리

 

반응형

'개발 > iOS' 카테고리의 다른 글

iOS디바이스 설정창 이동  (0) 2020.05.15
Xcode 한글 깨짐 복구  (0) 2020.05.15
WKWebView 스크린샷  (0) 2020.05.12
json 포멧 체크  (0) 2020.05.12
Access Control (접근 제한자)  (0) 2020.05.12
블로그 이미지

SKY STORY

,