title: How to escape ampersand in URL query?
body: <p>I've looked everywhere, and haven't found a single definitive answer in iOS. I'm trying to escape ampersands in my URL queries, but </p>
  
  <pre><code>stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())
  </code></pre>
  
  <p>doesn't help. </p>
  
  <p>As a dirty work-around, I've just been using </p>
  
  <pre><code>stringByReplacingOccurrencesOfString("&amp;", withString: "and", options: NSStringCompareOptions.LiteralSearch, range: nil)
  </code></pre>
  
  <p>although this isn't the safest bet. What's the right way.</p>