Želja Huber
Želja Huber

Reputation: 337

UITableViewCell image from web

I'm going to download images and titles from web (probably using AFNetworking) and insert inside UITableViewCell. Since images are not same size I'll need to calculate size for every cell.

Currently in my Post model I have title and imageURL. Should I first download all images, insert in array and then add to cell or should I use that AFNetworking function inside cellForRowAtIndexPath and download images from there?

Since I'm going to need images in both cellForRowAtIndexPath and heightForRow (for calculation), downloading all images first and storing in array might be better solution but dunno if cache is doing all the work so I could go with second approach?

Thanks.

Upvotes: 0

Views: 130

Answers (1)

Kumar KL
Kumar KL

Reputation: 15335

Fot the better performance,

You should approach for the Small sizes of images or few. downloading all images first and storing in array.

IF the images are huge, then should go for the Asynchronous task to display.

and then Use the custom UIImageView within the cell to show the image.

Upvotes: 1

Related Questions