O'Reilly logo

iOS Programming Cookbook by Hossam Ghareeb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using NSURLSession API for network connections

The NSURLSession is one of the greatest APIs that has been added to the iOS framework and is to be used in setting up connections between the app and the backend, and fetching contents from your server. In this section, we will talk in details (but not boring detail) about NSURLSession: how to deal with it, and what kind of tasks it can do. We will build a demo project for this chapter and, in each section, we will add a feature related to the topic in the project.

Getting ready

With Apple, by default, NSURLSession supports the following URL schemes:

  • File Transfer Protocol: (ftp://)
  • Hypertext Transfer Protocol: (http://)
  • Encrypted Hypertext Transfer Protocol: (https://)
  • File URLs: (file://)
  • Data URLs: ( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required