Open cchamnab opened 4 years ago
is it possible to load image using URL instead of download to UIImageView first ?
My working code like this, using Kingfisher 5.0
import Kingfisher
// ...
let imgView = UIImageView()
let galleryItem = GalleryItem.image { imageCompletion in
let pictureURL = URL(string: message.pictureURL)
imgView.kf.setImage(with: pictureURL, options: nil) { result in
guard let image = try? result.get().image else {
return
}
imageCompletion(image)
}
}
self.items.append(DataItem(imageView: imgView, galleryItem: galleryItem))
@KevinLiou your code seem load all image url before push to gallery show, sorry for my bad question, does it cause delay before present galleryVC ?
@KevinLiou your code seem load all image url before push to gallery show, sorry for my bad question, does it cause delay before present galleryVC ?
NO, because the picture files are downloaded asynchronously :)
thanks, your code help me a lot
is it possible to load image using URL instead of download to UIImageView first ?