-
-
Save ugommirikwe/9314ea42ef6711c6d02357940ade7374 to your computer and use it in GitHub Desktop.
Retrieve specific query string parameter from NSURL
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
func getQueryStringParameter(url: String, param: String) -> String? { | |
let url = NSURLComponents(string: url)! | |
return | |
(url.queryItems? as [NSURLQueryItem]) | |
.filter({ (item) in item.name == param }).first? | |
.value() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment