Instance Method


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)



The session that contains the waiting task.


The task that is waiting for a change in connectivity.


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