SHARE
TWEET

Untitled

a guest Mar 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Foundation
  2.  
  3. extension URL {
  4.     public mutating func deleteQuery() {
  5.         self = self.deletingQuery()
  6.     }
  7.        
  8.     public func deletingQuery() -> URL {
  9.         guard var components = URLComponents(url: self, resolvingAgainstBaseURL: false) else { return self }
  10.         components.query = nil
  11.         return components.url ?? self
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top