Skip to content

Instance Property

percentEncodedQueryItems

iOS 11.0+ iPadOS 11.0+ Mac Catalyst 11.0+ macOS 10.13+ tvOS 11.0+ watchOS 4.0+
The query subcomponent as an array of percent-encoded URLQueryItems.
var percentEncodedQueryItems: [URLQueryItem]? { get set }

Discussion

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. This property assumes the query item names and values are already correctly percent-encoded, and that the query item names do not contain the query item delimiter characters ‘&’ and ‘=’. Attempting to set an incorrectly percent-encoded query item or a query item name with the query item delimiter characters ‘&’ and ‘=’ will cause a fatalError.