Skip to content

Instantly share code, notes, and snippets.

View markiv's full-sized avatar

Vikram Kriplaney markiv

View GitHub Profile
import Foundation
extension URLComponents {
/// Abstracts away URLComponent’s array of URLQueryItems into a simple dictionary
var parameters: [String: CustomStringConvertible] {
get {
return queryItems?.reduce(into: [String: String]()) { $0[$1.name] = $1.value } ?? [:]
}
set {
queryItems = newValue.map { URLQueryItem(name: $0.key, value: String(describing: $0.value)) }

Keybase proof

I hereby claim:

  • I am markiv on github.
  • I am krips (https://keybase.io/krips) on keybase.
  • I have a public key ASAKJil3iYQZB9JTkiKN9znoKe5RRyc1eOCy5pkcfaCkIgo

To claim this, I am signing this object: