---
title: "urlSession(_:taskIsWaitingForConnectivity:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlsessiontaskdelegate/urlsession(_:taskiswaitingforconnectivity:)"
---

# urlSession(_:taskIsWaitingForConnectivity:)

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

## Declaration

```swift
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

Discussion This method is called if the  waitsForConnectivity property of 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.

## See Also

### Handling delayed and waiting tasks

- [urlSession(_:task:willBeginDelayedRequest:completionHandler:)](foundation/urlsessiontaskdelegate/urlsession(_:task:willbegindelayedrequest:completionhandler:).md)
- [URLSession.DelayedRequestDisposition](foundation/urlsession/delayedrequestdisposition.md)
