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

Can load images from URL? #24

Open
ingscjoshua opened this issue Jan 15, 2016 · 2 comments
Open

Can load images from URL? #24

ingscjoshua opened this issue Jan 15, 2016 · 2 comments

Comments

@ingscjoshua
Copy link

Hi i'm use loading images from URL it's posible use in this library?

@jesster2k10
Copy link

Hey I know this is pretty late but I'll leave this here for anybody that needs it. I'm using SDWebImage and in order to download an image from a URL you do something like this

func photoPagesController(_ controller: EBPhotoPagesController!, imageAt index: Int, completionHandler handler: ((UIImage?) -> Void)!) {
        SDWebImageManager.shared().loadImage(with: URL(string: photo.imageUrl)!, options: SDWebImageOptions.continueInBackground, progress: nil) { (image, _, error, _, _, _) in
            
            if let error = error {
                print("Error while donwloading image: \(error)")
                return
            }
            
            guard let image = image else {
                return
            }
            
            handler(image)
        }
    }

@jesster2k10
Copy link

The same idea applies to Objective C if you need to use that

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

2 participants