Automatic Remote Image Loading In an iOS Table View Controller
blog.parse.com
blog.parse.com
AFNetworking provides a similar category extension, but there is no obvious way to make it use an ondisk cache that survives app restarts, so its caching is not as useful as SDWebImage's.
If I'm misunderstanding what's happening please let me know...
In the Parse framework, the equivalent class is PFImageView. We chose to design our API differently; from my experience, I believe the assignment of the web image to load and the actual download of the images should be two different steps. This is evident in UITableViewController. In tableView:objectForRowAtIndexPath:, the app developer should know which URL to load, but we should not load the images at this point. Although you CAN achieve the same goal via the other two libraries' API, I feel strongly the API becomes more intuitive to use when the two steps are broken apart.
May I suggest you (optionally) animate the images to fade in instead of just switching them. This avoids the visual "popping", and really makes it look more polished.
I wrote/adapted something similar for my app a while ago:
https://github.com/geon/UIImageViewCached/blob/82c8b56564f8a...
I also implemented an optional spinner, which works better than a placeholder for larger-than-icon images.
In designing the API, I debated whether I should introduce a property that lets developer specify a loading behavior from a default set. I chose not to expose it for now and wait for some feedback; if this is a commonly asked feature, I can always introduce it later. I find, in the personal apps I build, this loading behavior is sufficient for 90% of them. Would love to hear others' feedback, though.