title: WKWebView issues with tel: links
body: <p>I've looked though a lot of the answers for this question but they seem to be outdated now and none of the solutions are working for me and just give lots of errors.</p>
  
  <p>I'm just gettign into xcode and apps and am loading a local html file "index.html" into a WKWebView. This is fine, loads fine, displays as it should, BUT I have some tel: links on the page which don't work, I tap on them and nothing. I am using fraework7 for my html files and have added the "external" class, which works in safari etc.</p>
  
  <p>UPDATE: Using the following code I can click on a link and it will try and call, but then gives a fatal error</p>
  
  <pre><code>import UIKit
  import WebKit
  class ViewController: UIViewController, WKNavigationDelegate{
  
      @IBOutlet weak var webview: WKWebView!
      override func viewDidLoad() {
          webview.navigationDelegate = self
          super.viewDidLoad()
          let htmlpath = Bundle.main.path(forResource: "index", ofType: "html")
          let url = URL(fileURLWithPath: htmlpath!)
          let request = URLRequest(url: url)
          webview.load(request)
          webview.scrollView.bounces = false
          webview.configuration.dataDetectorTypes = .phoneNumber
          // Do any additional setup after loading the view, typically from a nib.
      }
      func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -&gt; Swift.Void) {
          if navigationAction.request.url?.scheme == "tel" {
              UIApplication.shared.openURL(navigationAction.request.url!)
              decisionHandler(.cancel)
          }
          decisionHandler(.allow)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  
  }
  </code></pre>
  
  <p>and html looks like:</p>
  
  <pre><code>          &lt;tr&gt;
  
              &lt;td&gt;Police / Fire / Ambulance&lt;/td&gt;
  
              &lt;td&gt;Emergency Services&lt;/td&gt;
  
              &lt;td&gt;&lt;a href = "tel:999" class = "external"&gt;999&lt;/a&gt;&lt;/td&gt;
  
            &lt;/tr&gt;
  </code></pre>
  
  <p>obviously part of a larger table but this is the example.</p>
  
  <p>Any pointers would be greatly appreciated as I've been going round in circles for ages.</p>