Package apple.foundation.protocol
Interface NSURLSessionDataDelegate
-
- All Superinterfaces:
NSURLSessionDelegate,NSURLSessionTaskDelegate
public interface NSURLSessionDataDelegate extends NSURLSessionTaskDelegate
Messages related to the operation of a task that delivers data directly to the delegate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceNSURLSessionDataDelegate.Block_URLSessionDataTaskDidReceiveResponseCompletionHandlerstatic interfaceNSURLSessionDataDelegate.Block_URLSessionDataTaskWillCacheResponseCompletionHandler-
Nested classes/interfaces inherited from interface apple.foundation.protocol.NSURLSessionDelegate
NSURLSessionDelegate.Block_URLSessionDidReceiveChallengeCompletionHandler
-
Nested classes/interfaces inherited from interface apple.foundation.protocol.NSURLSessionTaskDelegate
NSURLSessionTaskDelegate.Block_URLSessionTaskDidReceiveChallengeCompletionHandler, NSURLSessionTaskDelegate.Block_URLSessionTaskNeedNewBodyStream, NSURLSessionTaskDelegate.Block_URLSessionTaskWillBeginDelayedRequestCompletionHandler, NSURLSessionTaskDelegate.Block_URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidURLSessionDataTaskDidBecomeDownloadTask(NSURLSession session, NSURLSessionDataTask dataTask, NSURLSessionDownloadTask downloadTask)Notification that a data task has become a download task.default voidURLSessionDataTaskDidBecomeStreamTask(NSURLSession session, NSURLSessionDataTask dataTask, NSURLSessionStreamTask streamTask)Notification that a data task has become a bidirectional stream task.default voidURLSessionDataTaskDidReceiveData(NSURLSession session, NSURLSessionDataTask dataTask, NSData data)Sent when data is available for the delegate to consume.default voidURLSessionDataTaskDidReceiveResponseCompletionHandler(NSURLSession session, NSURLSessionDataTask dataTask, NSURLResponse response, NSURLSessionDataDelegate.Block_URLSessionDataTaskDidReceiveResponseCompletionHandler completionHandler)The task has received a response and no further messages will be received until the completion block is called.default voidURLSessionDataTaskWillCacheResponseCompletionHandler(NSURLSession session, NSURLSessionDataTask dataTask, NSCachedURLResponse proposedResponse, NSURLSessionDataDelegate.Block_URLSessionDataTaskWillCacheResponseCompletionHandler completionHandler)Invoke the completion routine with a valid NSCachedURLResponse to allow the resulting data to be cached, or pass nil to prevent caching.-
Methods inherited from interface apple.foundation.protocol.NSURLSessionDelegate
URLSessionDidBecomeInvalidWithError, URLSessionDidFinishEventsForBackgroundURLSession, URLSessionDidReceiveChallengeCompletionHandler
-
Methods inherited from interface apple.foundation.protocol.NSURLSessionTaskDelegate
URLSessionTaskDidCompleteWithError, URLSessionTaskDidFinishCollectingMetrics, URLSessionTaskDidReceiveChallengeCompletionHandler, URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend, URLSessionTaskIsWaitingForConnectivity, URLSessionTaskNeedNewBodyStream, URLSessionTaskWillBeginDelayedRequestCompletionHandler, URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler
-
-
-
-
Method Detail
-
URLSessionDataTaskDidBecomeDownloadTask
default void URLSessionDataTaskDidBecomeDownloadTask(NSURLSession session, NSURLSessionDataTask dataTask, NSURLSessionDownloadTask downloadTask)
Notification that a data task has become a download task. No future messages will be sent to the data task.
-
URLSessionDataTaskDidBecomeStreamTask
default void URLSessionDataTaskDidBecomeStreamTask(NSURLSession session, NSURLSessionDataTask dataTask, NSURLSessionStreamTask streamTask)
Notification that a data task has become a bidirectional stream task. No future messages will be sent to the data task. The newly created streamTask will carry the original request and response as properties. For requests that were pipelined, the stream object will only allow reading, and the object will immediately issue a -URLSession:writeClosedForStream:. Pipelining can be disabled for all requests in a session, or by the NSURLRequest HTTPShouldUsePipelining property. The underlying connection is no longer considered part of the HTTP connection cache and won't count against the total number of connections per host.
-
URLSessionDataTaskDidReceiveData
default void URLSessionDataTaskDidReceiveData(NSURLSession session, NSURLSessionDataTask dataTask, NSData data)
Sent when data is available for the delegate to consume. It is assumed that the delegate will retain and not copy the data. As the data may be discontiguous, you should use [NSData enumerateByteRangesUsingBlock:] to access it.
-
URLSessionDataTaskDidReceiveResponseCompletionHandler
default void URLSessionDataTaskDidReceiveResponseCompletionHandler(NSURLSession session, NSURLSessionDataTask dataTask, NSURLResponse response, NSURLSessionDataDelegate.Block_URLSessionDataTaskDidReceiveResponseCompletionHandler completionHandler)
The task has received a response and no further messages will be received until the completion block is called. The disposition allows you to cancel a request or to turn a data task into a download task. This delegate message is optional - if you do not implement it, you can get the response as a property of the task. This method will not be called for background upload tasks (which cannot be converted to download tasks).
-
URLSessionDataTaskWillCacheResponseCompletionHandler
default void URLSessionDataTaskWillCacheResponseCompletionHandler(NSURLSession session, NSURLSessionDataTask dataTask, NSCachedURLResponse proposedResponse, NSURLSessionDataDelegate.Block_URLSessionDataTaskWillCacheResponseCompletionHandler completionHandler)
Invoke the completion routine with a valid NSCachedURLResponse to allow the resulting data to be cached, or pass nil to prevent caching. Note that there is no guarantee that caching will be attempted for a given resource, and you should not rely on this message to receive the resource data.
-
-