Protocol

IPAddress

An abstract protocol you use to interact with IP addresses.

Declaration

protocol IPAddress

Topics

Creating Addresses

init?(String)

Initializes an IP address with a string.

Required.

init?(Data, NWInterface?)

Initializes an IP address with data.

Required.

Inspecting Address Properties

var rawValue: Data

The raw data of an IP address.

Required.

var interface: NWInterface?

The interface associated with this address, such as the IPv6 scoped interface.

Required.

var isLinkLocal: Bool

A Boolean indicating whether this address is in a link-local range.

Required.

var isLoopback: Bool

A Boolean indicating whether this address is a loopback address for the local device.

Required.

var isMulticast: Bool

A Boolean indicating whether this address is a multicast address.

Required.

Relationships

Conforming Types

See Also

Internet Addresses

struct IPv4Address

A structure containing an IPv4 address.

struct IPv6Address

A structure containing an IPv6 address.