Why NSURLSession
- The NSURLSession Class and related classes provide an API (Application Interface Programming) for downloading content by way of HTTP(Hypertext Transfer Protocol).
- This API provide rich set of delegate method for supporting authentication and gives ability to your app performing Background download when your app is not running.
- If your app suspend then also NSURLSession rich delegate method ability to background run or download.
- NSURLSession API,your app create a series of session,each of which coordinates a group of related task.
- in Session there are three types of configuration object.
- 1) default sessions 2) ephemeral sessions 3) download sessions
- default session load the contents of a URL by providing a URL request object. You perform most of your configuration on the URL request object itself. default sessions that behave much like NSURLConnection.
- ephemeral session that do not cache anything to disk.
- download session that store the result in file and continue data even when your app is suspended,exits or crash.
- within session,you can schedule three type of task.
- 1) data tasks 2) download tasks 3) upload task
- data tasks for retrieving data to memory, download tasks for downloading file to disk, upload task for uploading a file from disk and receiving the response as data in memory.
- For More Information Please Visit
NSURLSession |
No comments:
Post a Comment