简体   繁体   中英

Image url loading in UITableViewCell Asynchronously But in a order

I am using SDWebImage for loading image in a asynchronously to avoid blocking of UI. But Image are not loading in a order way.

这是我的问题

I want to load image in a ordered way but asynchronously. I don't have exact word to define my problem. If you find any suitable words please edit my question.

Please provide me appropriate solution for it. It would be great if there is any third party library like SDWebImage to catch my requirement. Or it can be done with SDWebImage.

If you want to load your images in order, that is not what asynchronous is about... Asynchronous means, that all images currently visible are loading at the same time. But you don't know which image will be loaded the first, so that's why this happens.

If you would send a request for every image, and then wait for the response before you send a new request, this would take way to much time.

What you can do is, still load them asynchronously, but show them in an ordered way.

I see that you can load images independently too, so one option is to load the images that currently visible, and then show them in an order with the help of a counter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM