Collection

public extension Collection where Element == URLQueryItem

Support for native Collection object formed by URLQueryItem items

Available where Element == URLQueryItem

  • Returns -if available- the value for a parameter query within a URL Example of usage:

     let tweetURLAvatar = "https://wwww.twitter.com/avatar.png?width=500&&height=500"
     let components = URLComponent(validURL: tweetURLAvatar)
     components.queryItems?["width"] // 500
    

    Declaration

    Swift

    subscript(name: String) -> String? { get }