Last active
August 29, 2015 14:06
-
-
Save alexbosworth/7fb8c3b6bb4e1dec701b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = [String: String]() | |
if let queryString = url.query { | |
for q in queryString.componentsSeparatedByString("&") { | |
let pair = q.componentsSeparatedByString("=") | |
let value = pair[1] | |
.stringByReplacingOccurrencesOfString("+", withString: " ") | |
.stringByReplacingPercentEscapesUsingEncoding(NSUTF8StringEncoding) | |
query[pair[0]] = value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment