Skip to content

Instantly share code, notes, and snippets.

@stleamist
Created January 17, 2020 13:20
Show Gist options
  • Save stleamist/0a804b531832a0f078ac20c9e081c39a to your computer and use it in GitHub Desktop.
Save stleamist/0a804b531832a0f078ac20c9e081c39a to your computer and use it in GitHub Desktop.
import Foundation
extension URLComponents {
var fragmentItems: [URLQueryItem]? {
get {
var components = URLComponents()
components.query = fragment
return components.queryItems
}
set {
var components = URLComponents()
components.queryItems = newValue
self.fragment = components.query
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment