ios - Why do all the async image loading (SDWebImage, AFNetworking) libraries use UIImageView instead of UIImage? -


Am I missing something? It will not be allowed to be used with UIImage, is just more versatile than UIImageView? You can put hands around UIImage and use it for different things, where a UIImageView can actually be added only in the scene.

My initial idea was to keep it in another category and UIImage has been loaded so far, it will get zero and nothing new will be passed but if you If you pass UIImageView, will it apply?

FA networking

You are right, Implementation of Air Force Category (UIImageView + AFNetworking) is bare bones.

But you are missing out, which validate and decode images and provide some options to handle them. (In the old 1.x version of AFNetworking, this functionality is in.)

SDWebImage

Similarly, you are looking at only a very basic implementation of SDWebImage. There are so many options here, so I recommend that you review some other sections, but at the most basic level, you can get a UIImage like this:

  SDWebImageManager * manager = [SDWebImageManager sharedManager]; [Manager downloadWithURL: imageURL Option: kNilOptions Progress: ^ (NSUInteger received size, NSUInteger is expected) {// Update See a progress} Complete: ^ (UIImage * image, NSError * error, SDImageCacheType cacheType, BOOL end) {If (image) {// Do something with the image; The cache type tells you whether it was cached or not. }}]; Loading of asynchronous  

What if you put it in another category and UIImage has not loaded yet?

OK, all of this asynchronous is loaded, so the integer block will not be called until UIIm is loaded.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -