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

Downloading doesn't work via ImageDownloader #35

Closed
kafejo opened this issue Oct 14, 2015 · 5 comments
Closed

Downloading doesn't work via ImageDownloader #35

kafejo opened this issue Oct 14, 2015 · 5 comments
Assignees
Labels

Comments

@kafejo
Copy link

kafejo commented Oct 14, 2015

let downloader = ImageDownloader()
let URLRequest = NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/jpeg")!)

downloader.downloadImage(URLRequest: URLRequest) { response in
    if let image = response.result.value {
        print(image)
    }
}

The completion block isn't even called. Using Alamofire image response serializer works fine.

@cnoon
Copy link
Member

cnoon commented Oct 15, 2015

Your downloader is going out of scope. There are MANY tests verifying that the ImageDownloader does in fact work.

@cnoon cnoon closed this as completed Oct 15, 2015
@cnoon cnoon added the support label Oct 15, 2015
@cnoon cnoon self-assigned this Oct 15, 2015
@ishaq
Copy link
Contributor

ishaq commented Oct 27, 2015

would it be a good idea to highlight this somewhere in the documentation? I stumbled upon the same bug just now. while I understand it's programmer's fault here (downloadImage being an instance function rather than a static function, so it should imply saving the instance somewhere, correct?). I think since people are used to Alamofire.request (static function), they absent mindedly expect the same from ImageDownloader.

NOTE: the word bug above implies bug in my code, not in AlamofireImage :-)

@cnoon
Copy link
Member

cnoon commented Oct 27, 2015

Would you mind looking through the documentation in the ImageDownloader Section of the README to give a more specific suggestion on where to provide that info?

@ishaq
Copy link
Contributor

ishaq commented Oct 27, 2015

sure (in a couple of hours from now), would it be okay if I make the change and send PR?

@cnoon
Copy link
Member

cnoon commented Oct 27, 2015

That would be great!

ishaq added a commit to ishaq/AlamofireImage that referenced this issue Oct 28, 2015
added clarification for Alamofire#35
@ishaq ishaq mentioned this issue Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants