ImageViewer icon indicating copy to clipboard operation
ImageViewer copied to clipboard

can I provide array of imageURLs instead of images?

Open santhoshs5 opened this issue 7 years ago • 2 comments
trafficstars

I have an array of image URLs which should get downloaded cached automatically. If I scroll fast it should cancel previous requests and provide current request.

is it supports ?

santhoshs5 avatar Jan 28 '18 16:01 santhoshs5

The following is my experience. ImageViewer uses the exactly same UIImageView you used or you set. That means, ImageViewer will show the placeholder image first and then turn to the image asynchronously loaded from the server if you use something like "SDWebImage" set the UIImageView and do the following:

let imageView = UIImageView()
imageView.sd_setImage(with: URL("http://Image.com"), placeholderImage: UIImage(named: "placeholder"), options: [], completed: nil)

JunsW avatar Feb 19 '18 09:02 JunsW

use kingfisher

            let galleryItem = GalleryItem.image { imageCompletion in
                let item = self.resList[index]
                let imgpath = item["resourceUrl"] as! String
                imgView.kf.setImage(with: URL(string: imgpath.imageFullPath)!, placeholder: nil, options: nil,
                                    progressBlock: nil, completionHandler: { (img, _, _, _) in
                                        imageCompletion(img)
                })
            }
            imageItems.append( DataItem(imageView: imgView, galleryItem: galleryItem))

springlo avatar Mar 13 '18 09:03 springlo