Using the UIImageView+AFNetworking category
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 ...
Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.