From 1c0106bc5a2295ac0135e4382a56aca53bc2372a Mon Sep 17 00:00:00 2001 From: Scott Talbot Date: Wed, 11 Mar 2020 10:38:43 +1100 Subject: [PATCH] "Gather" "metrics" for tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … because Alamofire waits until metrics have been gathered before completing now. --- Sources/DVR/Session.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/DVR/Session.swift b/Sources/DVR/Session.swift index 2ecebc5..69502f9 100644 --- a/Sources/DVR/Session.swift +++ b/Sources/DVR/Session.swift @@ -149,6 +149,11 @@ open class Session: URLSession { } if let delegate = delegate as? URLSessionTaskDelegate { + if #available(iOSApplicationExtension 10.0, *) { + let metrics = URLSessionTaskMetrics() + delegate.urlSession?(self, task: task, didFinishCollecting: metrics) + } + delegate.urlSession?(self, task: task, didCompleteWithError: nil) } }