Thank you @Scott, but I'm afraid that supplying the delegate to URLSession.download(for:delegate:) does not work, just as it does not when supplying the delegate in the URLSession initializer.
At some point, I thought that maybe I needed to initialize the URLSession with a .background configuration instead of .default. However, when I did this, the line that calls URLSession.download(for:) throws an exception that exactly says: Completion handler blocks are not supported in background sessions. Use a delegate instead. I find this so bizarre since I am actually providing a delegate and I don't even have a way to provide a completion handler when calling the async function.
Topic:
App & System Services
SubTopic:
Networking
Tags: