Structure

NWPath

An object that contains information about the properties of the network that a connection uses, or that are available to your app.

Declaration

struct NWPath

Topics

Checking Path Availability

let status: NWPath.Status

A status indicating whether a path can be used by connections.

enum NWPath.Status

Status values indicating whether a path can be used by connections.

Inspecting Interfaces

func usesInterfaceType(NWInterface.InterfaceType) -> Bool

Checks if connections using the path may send traffic over a specific interface type.

let availableInterfaces: [NWInterface]

A list of all interfaces available to the path, in order of preference.

var gateways: [NWEndpoint]

A list of gateways configured on the interfaces available to a path.

Beta

Checking Path Capabilities

let supportsIPv4: Bool

A Boolean indicating whether the path can route IPv4 traffic.

let supportsIPv6: Bool

A Boolean indicating whether the path can route IPv6 traffic.

let supportsDNS: Bool

A Boolean indicating whether the path has a DNS server configured.

var isConstrained: Bool

A Boolean indicating whether the path uses an interface in Low Data Mode.

Beta
let isExpensive: Bool

A Boolean indicating whether the path uses an interface that is considered expensive, such as Cellular or a Personal Hotspot.

var debugDescription: String

The description of the network path.

Inspecting Connected Paths

let localEndpoint: NWEndpoint?

The local endpoint in use by a connection's network path.

let remoteEndpoint: NWEndpoint?

The remote endpoint in use by a connection's network path.

Comparing Paths

static func != (NWPath, NWPath) -> Bool

Returns a Boolean value indicating whether two values are not equal.

Relationships

See Also

Paths and Interfaces

class NWPathMonitor

An observer that you use to monitor and react to network changes.

struct NWInterface

An interface that a network connection uses to send and receive data.

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