Contents

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.

The getter for this property removes any percent encoding this component may have (if the component allows percent encoding). Setting this property assumes the subcomponent or component string isn’t percent encoded and adds percent encoding (if the component allows percent encoding).

See Also

Accessing components in native format