Async image downloader

前端 未结 5 1223
北海茫月
北海茫月 2021-02-01 11:37

I have write a little class to perform the download of the images by using an NSURLConnection. The idea it\'s to delegate the download to this class to avoid to block the execu

5条回答
  •  自闭症患者
    2021-02-01 12:11

    Cesar

    For async image loading, caching and threaded operation, I use SDImageCache class from http://github.com/rs/SDWebImage. I also wrote my own several times, but this one is brilliant and I've thrown all my old code away.

    From its documentation:

    Just #import the UIImageView+WebCache.h header, and call the setImageWithURL:placeholderImage: method from the tableView:cellForRowAtIndexPath: UITableViewDataSource method. Everything will be handled for you, from async downloads to caching management.

    Hilton

提交回复
热议问题