Async Images Download in a UITableView using Story

2019-08-18 14:21发布

I have a UITableView and I had like to download images asynchronously. How can I do using using ios5 and storyboards?

Thanks in advance

1条回答
小情绪 Triste *
2楼-- · 2019-08-18 14:41

I was having the very same problem, and what I did was take SDWebImage from https://github.com/rs/SDWebImage, open up the project on its own, and manually upgrade it to Objective C ARC (Refactor --> Convert to Objective C ARC).

When it was done being converted, I added it the individual files to my project and it works like a charm. I just

#import "UIImageView+WebCache.h"

and then in my - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method, it loks like this:

[cell.videoImageView setImageWithURL:[NSURL URLWithString:thumbnailURLString]];

Simple!

查看更多
登录 后发表回答