queryItems
An array of query items for the URL in the order in which they appear in the original query string.
Declaration
var queryItems: [URLQueryItem]? { get set }Discussion
Each URLQueryItem represents a single key-value pair,
Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the URLComponents has an empty query component, returns an empty array. If the URLComponents has no query component, returns nil.
The setter combines an array containing any number of URLQueryItems, each of which represents a single key-value pair, into a query string and sets the URLComponents query property. Passing an empty array sets the query component of the URLComponents to an empty string. Passing nil removes the query component of the URLComponents.