Instance Property

host

The host URL subcomponent, or nil if not present.

Declaration

var host: String? { get set }

Discussion

For example, in the URL http://www.example.com/index.html, the host is www.example.com.

See Also

Accessing Components in Native Format

var fragment: String?

The fragment URL component (the part after a # symbol), or nil if not present.

var password: String?

The password URL subcomponent, or nil if not present.

var path: String?

The path URL component, or nil if not present.

var port: NSNumber?

The port number URL component, or nil if not present.

var query: String?

The query URL component as a string, or nil if not present.

var queryItems: [URLQueryItem]?

The query URL component as an array of name/value pairs.

var scheme: String?

The scheme URL component, or nil if not present.

var user: String?

The username URL subcomponent, or nil if not present.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software