title: Detect click on link in UIWebView
body: <p>I am not able to detect a tap on a link inside a <code>UIWebView</code>. Not sure what I am doing wrong, but there are nothing logged when navigating by clicking links in my <code>UIWebView</code>.</p>
  
  <p>This is my <code>WebViewController</code></p>
  
  <pre><code>import UIKit
  
  @available(iOS 10.0, *)
  class WebsiteViewController: UIViewController, UIWebViewDelegate {
  
  @IBOutlet var backButton: UIBarButtonItem!
  @IBOutlet var webview: UIWebView!
  @IBOutlet var navigationBar: UINavigationBar!
  
  let user = UserDefaults.standard
  
  override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -&gt; Bool {
  
      if webview.canGoBack {
          webview.goBack()
  
          return true
      }
  
      return false
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      navigationBar.topItem?.title = ""
  
      let url = URL(string: "http://" + user.string(forKey: "site")!)
  
      webview.loadRequest(URLRequest(url: url!))
  
      //webview.allowsBackForwardNavigationGestures = true
  
      // Do any additional setup after loading the view.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -&gt; Bool {
      print("test log a click")
      print(navigationType)
      return true
  }
  
  }
  </code></pre>
  
  <p>What am I doing wrong here? I can't see it.</p>