Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load URL direct #230

Open
cchamnab opened this issue Nov 2, 2019 · 4 comments
Open

Load URL direct #230

cchamnab opened this issue Nov 2, 2019 · 4 comments

Comments

@cchamnab
Copy link

cchamnab commented Nov 2, 2019

is it possible to load image using URL instead of download to UIImageView first ?

@KevinLiou
Copy link

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))

@fukemy
Copy link

fukemy commented Jun 8, 2020

@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
Copy link

@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 :)

@fukemy
Copy link

fukemy commented Jun 8, 2020

thanks, your code help me a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants