iOS apps, when connected to the Internet, become more lively. For example, imagine an app that brings high-quality wallpapers to its users. The user can pick from a big list of wallpapers and assign any of those images as his iOS background. Now consider an app that does the same thing, but adds to its list of wallpapers every day, week, or month. The user comes back to the app, and voilà! Tons of new wallpapers are dynamically added to the app. That is the magic of web services and the Internet. This can easily be achieved with basic knowledge of networking, XML, JSON, and sharing options along with some creativity on the app developer’s part.
The iOS SDK allows us to connect to the Internet and retrieve and send data using the
NSURLConnection class. JSON
serialization and deserialization will all be done using the
NSJSONSerialization class. XML parsing will be
NSXMLParser, and the Twitter
connectivity will be done using the Twitter framework.
iOS 7 SDK brings along new classes that we can take advantage of in this chapter. One of these classes is the
NSURLSession, which manages the connectivity to web services in a more thorough way than the
NSURLConnection class does, as we shall see later in this chapter.
You want to download a file from a URL, asynchronously.
with an asynchronous request.
There are ...