ImageViewer
ImageViewer copied to clipboard
can I provide array of imageURLs instead of images?
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 ?
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)
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))