Skip to content

Instantly share code, notes, and snippets.

@gillesdemey
Last active March 24, 2021 10:53
Show Gist options
  • Save gillesdemey/509bb8a1a8c576ea215a to your computer and use it in GitHub Desktop.
Save gillesdemey/509bb8a1a8c576ea215a to your computer and use it in GitHub Desktop.

Revisions

  1. gillesdemey revised this gist Nov 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion querystring.swift
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    func getQueryStringParamater(url: String, param: String) -> String? {
    func getQueryStringParameter(url: String, param: String) -> String? {

    let url = NSURLComponents(string: url)!

  2. gillesdemey created this gist Nov 21, 2014.
    9 changes: 9 additions & 0 deletions querystring.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    func getQueryStringParamater(url: String, param: String) -> String? {

    let url = NSURLComponents(string: url)!

    return
    (url.queryItems? as [NSURLQueryItem])
    .filter({ (item) in item.name == param }).first?
    .value()
    }