Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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:
@wagpinto
Copy link

wagpinto commented Sep 8, 2015

wow, life saver! Thank you

@alemangui
Copy link

alemangui commented Oct 8, 2015

Awesome, thanks!

@grapefruitpower
Copy link

grapefruitpower commented Oct 13, 2015

thanks!

@chenzilu1990
Copy link

chenzilu1990 commented Dec 2, 2015

soga

@jackhub
Copy link

jackhub commented Dec 9, 2015

Thanks a lot!

@dmhts
Copy link

dmhts commented Dec 24, 2015

Woah! Thanks!

@wanggang316
Copy link

wanggang316 commented Dec 25, 2015

Thanks!

@githubdelegate
Copy link

githubdelegate commented Feb 5, 2016

Thanks

@YuliiaVeres
Copy link

YuliiaVeres commented Feb 14, 2016

Thanks !!!

@ifwrite
Copy link

ifwrite commented Feb 25, 2016

Thanks

@matchboxy
Copy link

matchboxy commented Apr 19, 2016

lift saver, tks

@seyi
Copy link

seyi commented Apr 20, 2016

wow..thanks

@melochale
Copy link

melochale commented Jun 21, 2016

great, thanks a lot.

@starmuse
Copy link

starmuse commented Aug 31, 2016

nice

@deckarlc
Copy link

deckarlc commented Sep 1, 2016

wow, nice~

@naeemshaikh90
Copy link

naeemshaikh90 commented Sep 7, 2016

Great Work

@wongzigii
Copy link

wongzigii commented Feb 12, 2017

👍

@Jerry4me
Copy link

Jerry4me commented Mar 20, 2017

Marvelous! Thanks.

@carlosvKC
Copy link

carlosvKC commented May 10, 2017

Yeah! Gracias

@rememberkarl
Copy link

rememberkarl commented Jul 12, 2017

Thanks a lot!

@xiaohuiCoding
Copy link

xiaohuiCoding commented Jul 17, 2017

Good!Thanks!

@himyfairy
Copy link

himyfairy commented Sep 5, 2017

many thanks!

@timcolla
Copy link

timcolla commented Jan 24, 2018

Still helping developers in 2018!

@zihanzzz
Copy link

zihanzzz commented Mar 13, 2018

awesome to see this! thanks.

@coderChrisLee
Copy link

coderChrisLee commented May 21, 2018

Thanks a lot.

@wving5
Copy link

wving5 commented Mar 1, 2019

Good job, thx.
connection:didWriteData:totalBytesWritten:expectedTotalBytes: matching URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:, is it an unintentional mistake ?

@Deniffer
Copy link

Deniffer commented Mar 31, 2022

Thinks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment