Closed vox-humana closed 2 years ago
Thanks, @vox-humana. That's a good start.
I'm thinking of eventually switching to a delegate-based approach. Without it, unlike the new async APIs, there is no way to get URLSession callbacks. I want to make Pulse integration easy.
Totally understand your point about delegate-based API and further Pulse integration. Here I just wanted to illustrate in code what was mentioned in this thread, closing the PR for now.
Custom implementation of a compatible async
URLSession
method for using on older OS versions.URLSessionDelegate
URLSessionTask
access. Initial proposal didn't require any wrapper. However, in the current implementation compiler doesn't allow to capture mutableURLSessionTask
directly.Requires Xcode 13.2 beta 2
https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes