Load a picture using Sdwebimage fade
Effect:
Please download the source code in the following ways:
Locate the file where it was modified:
The following is the use of source code:
////VIEWCONTROLLER.M//Sdwebimagefade////Created by youxianming on 14-10-5.//Copyright (c) 2014 youxianming. All rights reserved.//#import "ViewController.h"#import "uiimageview+webcache.h"@interfaceViewcontroller ()@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; NSString*picurl =@"http://th04.deviantart.net/fs70/PRE/i/2014/277/4/b/cheetahr_by_harpiya-d81l8iv.jpg"; Uiimageview*imageview =[[Uiimageview alloc] initWithFrame:self.view.bounds]; [Self.view Addsubview:imageview]; [ImageView setimagewithurl:[nsurl Urlwithstring:picurl] Placeholderimage:nil OPTIONS:SD Webimagecachememoryonly Progress:^(Nsinteger receivedsize, Nsinteger expectedsize) {NSLog (@"%.2f", (float) Receivedsize/(float) expectedsize); } Completed:^ (UIImage *image, Nserror *error, Sdimagecachetype cachetype) { }];}@end
Here are some places to be aware of
Load a picture using Sdwebimage fade