Class

NWPath

The path made by a network connection, including information about its viability.

Declaration

class NWPath : NSObject

Overview

For example, if the path status is NWPathStatus.satisfied, then a connection attempt will be made.

When attached to a specific connection, a path takes all of the connection parameters into account. For example, if the route for a connection changes or is removed, the path will reflect that change. Note that every path is evaluated within the context of the process it is running in, and may be different across processes.

NWPath is a static object, and properties of the path will never change. To monitor changing network status, use Key-Value Observing (KVO) to watch a path property on another object. For information about KVO, see Key-Value Observing Programming Guide.

Topics

Getting Network Path Properties

var status: NWPathStatus

The evaluated status of the network path

var isExpensive: Bool

A Boolean that indicates whether or not the path uses an expensive interface

Comparing Network Paths

func isEqual(to: NWPath) -> Bool

Comparison method for NWPath objects

Relationships

Inherits From

Conforms To

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