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

How does this integrate at all with SDWebImage #44

Closed
Viktorfalkner opened this issue Mar 29, 2017 · 3 comments
Closed

How does this integrate at all with SDWebImage #44

Viktorfalkner opened this issue Mar 29, 2017 · 3 comments

Comments

@Viktorfalkner
Copy link

Your delegate methods need an optional UIImage, however SDWebImage sets an image on an ImageView.

Am I supposed to create a random ImageView and pass back the image I get from SDWebImage?

Or how do I utilize this library with SDWebImage?

@justinvallely
Copy link
Owner

SDWebImage can do more than just set an image on an ImageView. Use the download manager to prefetch the image and then pull the image from SD's image cache using imageFromDiskCache(forKey: to add it to SwiftPhotoGallery.

let manager: SDWebImageManager = SDWebImageManager.shared()
            manager.downloadImage(with: fullURL, options: [], progress: {(_, _) -> Void in
                // progression tracking code
                }, completed: {(_, _, _, _, _) -> Void in
                    // completion block
            })

@SamDecrock
Copy link

SamDecrock commented Nov 20, 2017

That download block is asynchronously, how can I use it to return a UIImage upon...

func imageInGallery(gallery: SwiftPhotoGallery, forIndex: Int) -> UIImage? 

?

Repository owner deleted a comment from DarkwingXL Feb 15, 2018
@CocoaPriest
Copy link

But what's the point writing Integrates seamlessly with SDWebImage then? It doesn't really do that at all.

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

4 participants