We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c91c99d commit 78e2f94Copy full SHA for 78e2f94
Foundation/URLSession/URLSessionTask.swift
@@ -428,7 +428,13 @@ open class URLSessionDownloadTask : URLSessionTask {
428
* If resume data cannot be created, the completion handler will be
429
* called with nil resumeData.
430
*/
431
- open func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) { NSUnimplemented() }
+ open func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) {
432
+ super.cancel()
433
+
434
+ // A token Data value is passed to the client to prevent unexpected
435
+ // failures that may be caused by passing nil instead
436
+ completionHandler(Data())
437
+ }
438
}
439
440
/*
0 commit comments