title: Swift ShouldStartLoadWith not working when detect url
body: <p>My application contains Webview To Show Payment Form and when we have done with filling data we can push Done button then Webview will redirect to other Url. I've already searched for this function and I found shouldStartLoadWith function to solve this problem but when I'm implementing this, it's not working</p>
  
  <p>Here is my Code: </p>
  
  <pre><code>func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -&gt; Bool {
  
          if request.url?.absoluteString == "https://xyzbank.com" {
  
              print("SUCCESS")
              return false
          }
          print("NOT SUCCESS")
          return true
      }
  </code></pre>
  
  <p>It's not print either of them. </p>
  
  <p>Here is the rest of my code: <strong>I think that i've already called the delegate method of webview but it's still not working</strong></p>
  
  <pre><code>override func viewDidLoad() {
          super.viewDidLoad()
  
          hud.textLabel.text = "Processing..."
          hud.show(in: self.view)
          let mpayment: Payment = params.payment
  
          mywebview.navigationDelegate = self
          //Showing webview url....
  
  
      }
  
      func webView(webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: NSError) {
          print(error.localizedDescription)
      }
      func webView(webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
          print("Start to load")
      }
      func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
          print("DID FINISH NAVIGATION")
      }
      func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
          self.hud.textLabel.text = "Success"
          self.hud.detailTextLabel.text = nil
          self.hud.dismiss(animated: true)
      }
  
      func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -&gt; Bool {
  
          if request.url?.absoluteString == "https://example.com" {
  
              print("SUCCESS")
              return false
          }
          print("NOT SUCCESS")
          return true
      }
  </code></pre>