AFNetworking makes downloading images incredibly easy and provides a category for the UIImageView
class that adds a method to download images asynchronously from the Internet and display them. The method added to the
UIImageView
class is setImageWithURL:placeholder:
, which places a temporary image in the UIImageView
class while it downloads the final image asynchronously from the URL provided. As you will see in this recipe, this method is really useful when building a UITableView
, where each cell contains an image that needs to be downloaded from the Internet.
In the Creating a web client using AFHTTPSessionManager recipe, we created our ITunesClient
class to call the iTunes Search API. Then, in the Creating a custom response serializer recipe, we added a custom-response serializer to extract the information that was returned from the iTunesSearch API. In this recipe, we will display this information, including the images, in the UITableView
class...