States indicating whether a connection can be used to send and receive data.


enum NWConnection.State



case setup

The connection has been initialized but not started.

case waiting(NWError)

The connection is waiting for a network path change.

case preparing

The connection in the process of being established.

case ready

The connection is established, and ready to send and receive data.

case failed(NWError)

The connection has disconnected or encountered an error.

case cancelled

The connection has been canceled.

Operator Functions

static func != (NWConnection.State, NWConnection.State) -> Bool

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


Conforms To

See Also

Handling State Updates

var state: NWConnection.State

The current state of the connection.

var stateUpdateHandler: ((NWConnection.State) -> Void)?

A handler that receives connection state updates.

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