title: URL Encoding swift IOS
body: <p>I am using following code to encode my string url</p>
  
  <pre><code>let originalString = "test/test"
  let escapedString = originalString.addingPercentEncoding(withAllowedCharacters: . urlQueryAllowed)
  print(escapedString!)
  </code></pre>
  
  <p>I am looking for Swift extension to encode url so that I don't have to write code every time. How to create extension to encode url</p>