An NWPath object represents a snapshot of network path state. This state
represents the known information about the local interface and routes that may
be used to send and receive data. If the network path for a connection changes
due to interface characteristics, addresses, or other attributes, a new NWPath
object will be generated. Note that the differences in the path attributes may not
be visible through public accessors, and these changes should be treated merely
as an indication that something about the network has changed.
Members (15)
get · iOS 12.0+
isExpensive
TypeScript
get isExpensive(): boolean
Swift declaration
let isExpensive: Bool
Checks if the path uses an NWInterface that is considered to be expensive
Cellular interfaces are considered expensive. WiFi hotspots from an iOS device are considered expensive. Other
interfaces may appear as expensive in the future.
get · iOS 26.0+
linkQuality
TypeScript
get linkQuality(): NWPath_LinkQuality
Swift declaration
var linkQuality: NWPath.LinkQuality { get }
Represents the link quality measurement of the link layer network attachment
Use this value to tune initial values for algorithms that can scale with the
capabilities of the network. Do not use this value to gate connection attempts or
to override adjustments that would be made based on actual network performance.
get · iOS 12.0+
supportsDNS
TypeScript
get supportsDNS(): boolean
Swift declaration
let supportsDNS: Bool
get · iOS 12.0+
supportsIPv4
TypeScript
get supportsIPv4(): boolean
Swift declaration
let supportsIPv4: Bool
get · iOS 12.0+
supportsIPv6
TypeScript
get supportsIPv6(): boolean
Swift declaration
let supportsIPv6: Bool
get · iOS 13.0+
isConstrained
TypeScript
get isConstrained(): boolean
Swift declaration
var isConstrained: Bool { get }
Checks if the path uses an NWInterface that is considered to be constrained
by user preference
get · iOS 12.0+
localEndpoint
TypeScript
get localEndpoint(): (NWEndpoint) | null
Swift declaration
let localEndpoint: NWEndpoint?
Check the local endpoint set on a path. This will be nil for paths
from an NWPathMonitor. For paths from an NWConnection, this will
be set to the local address and port in use by the connection.
get · iOS 12.0+
remoteEndpoint
TypeScript
get remoteEndpoint(): (NWEndpoint) | null
Swift declaration
let remoteEndpoint: NWEndpoint?
Check the remote endpoint set on a path. This will be nil for paths
from an NWPathMonitor. For paths from an NWConnection, this will
be set to the remote address and port in use by the connection.
get · iOS 12.0+
debugDescription
TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 14.2+
unsatisfiedReason
TypeScript
get unsatisfiedReason(): NWPath_UnsatisfiedReason
Swift declaration
var unsatisfiedReason: NWPath.UnsatisfiedReason { get }