<!--
{
  "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/URLSessionTaskDelegate/urlSession(_:taskIsWaitingForConnectivity:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSURLSessionTaskDelegate(im)URLSession:taskIsWaitingForConnectivity:"
  },
  "title" : "urlSession(_:taskIsWaitingForConnectivity:)"
}
-->

# urlSession(_:taskIsWaitingForConnectivity:)

Tells the delegate that the task is waiting until suitable connectivity is available before beginning the network load.

```
optional func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task: URLSessionTask)
```

## Parameters

`session`

The session that contains the waiting task.

`task`

The task that is waiting for a change in connectivity.

## Discussion

This method is called if the  [`waitsForConnectivity`](/documentation/Foundation/URLSessionConfiguration/waitsForConnectivity) property of [`URLSessionConfiguration`](/documentation/Foundation/URLSessionConfiguration) is `true`, and sufficient connectivity is unavailable. The delegate can use this opportunity to update the user interface; for example, by presenting an offline mode or a cellular-only mode.

This method is called, at most, once per task, and only if connectivity is initially unavailable. It is never called for background sessions because `waitsForConnectivity` is ignored for those sessions.

---

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)