ios - How to use success & failure block in SDwebimage -
i have latest version of sdwebimage
doesnt have success & failure tried following method sdwebimage
doesnt have method
[self.imageview setimagewithurl:[nsurl urlwithstring:self.imageurl] placeholderimage:[uiimage imagenamed:@"yourplaceholder.png"] success:^(uiimage *image) { // remove animation } failure:^(nserror *error) { nslog(@"thumbnail error: %@",error); // handle failed download }];
does know how add success & failure block in sdwebimage
setimagewithurl
or other alternatife want handle if there error while getting image url
try this:
[self.imageview setimagewithurl:[nsurl urlwithstring:imageurl] placeholderimage:[uiimage imagenamed:@"yourplaceholder.png"] completed:^(uiimage *image, nserror *error, sdimagecachetype cachetype) { //... completion code here ... }];
Comments
Post a Comment