Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks to @b1ackturtle for providing the foundation of this work in #4705!
This PR implements the remaining async
URLSession
methods and theURLSessionTask.delegate
property, allowing a delegate to be set in the async methods (or in a non-async context before resumption).URLSessionTask.delegate
returns the explicitly set delegate if present, otherwise returns the session delegateas? URLSessionTaskDelegate
. It's now used wherever we previously casted the session delegate toURLSessionTaskDelegate
. To accompany this change, functions inextension URLSessionTaskDelegate
(which are called if not implemented by the task's delegate) now check if the session's delegate implements it and call the session's delegate if that's the case.