Last active
March 24, 2021 10:53
-
-
Save gillesdemey/509bb8a1a8c576ea215a to your computer and use it in GitHub Desktop.
Retrieve specific query string parameter from NSURL
This file contains hidden or 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
I'm using
Objective - C
and CategoriesHeader file
Implementation