0

I am loading images in my collection view using SDWebImage like so...

cell.imageView.sd_setImage(with: url, placeholderImage:UIImage(named:"appLogo.jpg"))

Now I want in an array all the images thus obtained from the url & assigned to the imageView . So what should be done.

Please note..I don't want the url's in an array but instead the images I get from those url's.

  • Use `sd_setImageWithURL:placeholderImage:completed:` instead and in the `completed` closure, add the image obtained in your array? – Larme Oct 30 '17 at 13:59
  • hmm...ok..could you mind giving the format you suggested to the line of code I put..? –  Oct 30 '17 at 14:01
  • https://stackoverflow.com/a/41956568/1801544 for the code. You have in the closure "image", "append it to your array" (I'd say that a dict with key as "index" may be better solution)? – Larme Oct 30 '17 at 14:02
  • ok..let me check.. –  Oct 30 '17 at 14:04
  • Thanks for the link, @Larme..it worked!..Do put it up as an answer andI'll accept it... –  Oct 30 '17 at 14:33

0 Answers0