Sdwebimage is hosted on GitHub. Https://github.com/rs/SDWebImage
This class library provides a uiimageview category to support the loading of remote pictures from the network. Features such as cache management, asynchronous download, same URL download count control, and optimization.
When you add a Sdwebimage class library to your project, you must be aware that you need to add mapkit.framework, because Mkannotationview+webcache.h relies on the framework.
Using the demo code
1, Uiimageview use Uiimageview+webcache class (Basic application, a category of Uiimageview)
Premise #import Import uiimageview+webcache.h file, method:
Uiimageview *imageview = [[Uiimageview alloc] init];
[ImageView Setimagewithurl:bannerlasturl Placeholderimage:nil];
2, using the Sdwebimagemanager class: You can do some asynchronous loading work.
Of course your class wants to implement the Sdwebimagemanagerdelegate protocol, and to implement the webimagemanager:didfinishwithimage of the Protocol : method.
3. Standalone asynchronous image download
May be used alone to download asynchronous pictures, you must use downloaderwithurl:delegate: To create a Sdwebimagedownloader instance
This method of Sdwebimagedownloaderdelegate protocol imagedownloader:didfinishwithimage: The download will start immediately and complete when it is invoked.
4. Stand-alone asynchronous image caching
The Sdimagecache class provides an instance of creating an empty cache and uses method Imageforkey: To find the current cache
Storing an image to the cache is a way to use Storeimage:forkey:
By default, images are stored in the memory cache and in the disk cache. If you want to use StoreImage:forKey:toDisk in memory cache only: The third parameter of the method takes a negative value
To replace.
Sdwebimage use--a class library to manage remote picture loading