Skip to content

Commit c37b86a

Browse files
committed
Added delegate method urlSession(:task:willBeginDelayedRequest) as it uses new DelayedRequestDisposition enum
1 parent 4bbd267 commit c37b86a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Foundation/URLSession/URLSessionDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public protocol URLSessionTaskDelegate : URLSessionDelegate {
119119
* nil, which implies that no error occurred and this task is complete.
120120
*/
121121
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)
122+
123+
func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void)
122124
}
123125

124126
extension URLSessionTaskDelegate {
@@ -137,6 +139,8 @@ extension URLSessionTaskDelegate {
137139
public func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { }
138140

139141
public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { }
142+
143+
public func urlSession(_ session: URLSession, task: URLSessionTask, willBeginDelayedRequest request: URLRequest, completionHandler: @escaping (URLSession.DelayedRequestDisposition, URLRequest?) -> Void) { }
140144
}
141145

142146
/*
@@ -194,6 +198,7 @@ public protocol URLSessionDataDelegate : URLSessionTaskDelegate {
194198
* message to receive the resource data.
195199
*/
196200
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse, completionHandler: @escaping (CachedURLResponse?) -> Void)
201+
197202
}
198203

199204
extension URLSessionDataDelegate {

0 commit comments

Comments
 (0)