<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionConfiguration/waitsForConnectivity",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLSessionConfiguration(py)waitsForConnectivity"
  },
  "title" : "waitsForConnectivity"
}
-->

# waitsForConnectivity

A Boolean value that indicates whether the session should wait for connectivity to become available, or fail immediately.

```
var waitsForConnectivity: Bool { get set }
```

## Discussion

Connectivity might be temporarily unavailable for several reasons. For example, a device might only have a cellular connection when [`allowsCellularAccess`](/documentation/Foundation/URLSessionConfiguration/allowsCellularAccess) is set to `false`, or the device might require a VPN connection but none is available. If the value of this property is `true` and sufficient connectivity is unavailable, the session calls the [`urlSession(_:taskIsWaitingForConnectivity:)`](/documentation/Foundation/URLSessionTaskDelegate/urlSession(_:taskIsWaitingForConnectivity:)) method of [`URLSessionTaskDelegate`](/documentation/Foundation/URLSessionTaskDelegate) and waits for connectivity. When connectivity becomes available, the task begins its work and ultimately calls the delegate or completion handler as usual.

If the value of the property is `false` and connectivity is unavailable, the connection fails immediately with an error, such as [`NSURLErrorNotConnectedToInternet`](/documentation/Foundation/NSURLErrorNotConnectedToInternet-swift.var).

This property is relevant only during the establishment of a connection. If a connection is established and then drops, the completion handler or delegate receives an error, such as [`NSURLErrorNetworkConnectionLost`](/documentation/Foundation/NSURLErrorNetworkConnectionLost-swift.var). For help dealing with dropped connections, see [Handling “The network connection was lost” Errors](https://developer.apple.com/library/archive/qa/qa1941/_index.html#//apple_ref/doc/uid/DTS40017602).

This property is ignored by background sessions, which always wait for connectivity.

---

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)