title: WKWebView - Add a parameter to the URL on redirect in Swift - iOS
body: <p>I am new to Swift, currently using swift 4.0 and have a very simple app with WKWebView loading a web page.</p>
  
  <p>I have a requirement to append a parameter to a URL when page redirects from one page to another.</p>
  
  <p>I am getting the redirection event in this function:</p>
  
  <pre><code>func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping ((WKNavigationActionPolicy) -&gt; Void)) {
  
  }
  </code></pre>
  
  <p>But here I am not sure how to update the URL by adding a parameter to it and then do the navigation. Please help in this regard to update the URL before navigating.</p>
  
  <p>I have searched for it and tried to figure out the way to do it but so far I haven't progressed. The <code>navigationAction.action.url</code> is GET only and I am not able to update it.</p>