<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWConnection/State-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWConnectionC5StateO"
  },
  "title" : "NWConnection.State"
}
-->

# NWConnection.State

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

```
enum State
```

## Topics

### States

[`NWConnection.State.setup`](/documentation/Network/NWConnection/State-swift.enum/setup)

The connection has been initialized but not started.

[`NWConnection.State.waiting(_:)`](/documentation/Network/NWConnection/State-swift.enum/waiting(_:))

The connection is waiting for a network path change.

[`NWConnection.State.preparing`](/documentation/Network/NWConnection/State-swift.enum/preparing)

The connection in the process of being established.

[`NWConnection.State.ready`](/documentation/Network/NWConnection/State-swift.enum/ready)

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

[`NWConnection.State.failed(_:)`](/documentation/Network/NWConnection/State-swift.enum/failed(_:))

The connection has disconnected or encountered an error.

[`NWConnection.State.cancelled`](/documentation/Network/NWConnection/State-swift.enum/cancelled)

The connection has been canceled.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)