Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save crespoxiao/d39b31eb96afcd03e6ab7adfa67dcc2c to your computer and use it in GitHub Desktop.
Save crespoxiao/d39b31eb96afcd03e6ab7adfa67dcc2c to your computer and use it in GitHub Desktop.
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| NSURLSessionTaskDelegate URLSession:task:didReceiveChallenge:completionHandler:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willCacheResponse: | NSURLSessionDataDelegate URLSession:dataTask:willCacheResponse:completionHandler:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:didFailWithError: | NSURLSessionTaskDelegate URLSession:task:didCompleteWithError:
NSURLConnectionDataDelegate connectionDidFinishLoading: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDataDelegate connection:willSendRequest:redirectResponse: | NSURLSessionTaskDelegate URLSession:willPerformHTTPRedirection:newRequest:completionHandler:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDataDelegate connection:didReceiveResponse: | NSURLSessionDataDelegate URLSession:dataTask:didReceiveResponse:completionHandler:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDataDelegate connection:didReceiveData: | NSURLSessionDataDelegate URLSession:dataTask:didReceiveData:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDataDelegate connection:needNewBodyStream: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDataDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDownloadDelegate connection:didWriteData:totalBytesWritten:expectedTotalBytes: | NSURLSessionTaskDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDownloadDelegate connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDownloadDelegate connectionDidFinishDownloading:destinationURL: | NSURLSessionDownloadDelegate URLSession:downloadTask:didFinishDownloadingToURL:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
| NSURLSessionDelegate URLSession:didBecomeInvalidWithError:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
| NSURLSessionDataDelegate URLSession:dataTask:didBecomeDownloadTask:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
| NSURLSessionDataDelegate URLSessionDidFinishEventsForBackgroundURLSession:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
| NSURLSessionDownloadDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
| NSURLSessionDownloadDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment