URLComponents
A structure that parses URLs into and constructs URLs from their constituent parts.
Declaration
struct URLComponentsOverview
This structure parses and constructs URLs according to RFC 3986. Its behavior differs subtly from that of the URL structure, which conforms to older RFCs. However, you can easily obtain a URL value based on the contents of a URLComponents value or vice versa.
Topics
Creating URL components
Getting the URL
Accessing components in native format
Accessing components in URL-encoded format
percentEncodedFragmentpercentEncodedHostpercentEncodedPasswordpercentEncodedPathpercentEncodedQuerypercentEncodedQueryItemsURLQueryItempercentEncodedUser