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

Fast Image Cache with progress indicator #119

Open
pmurphyjam opened this issue Oct 23, 2015 · 0 comments
Open

Fast Image Cache with progress indicator #119

pmurphyjam opened this issue Oct 23, 2015 · 0 comments

Comments

@pmurphyjam
Copy link

Anyway to add the ability to have a download progress indicator for Fast Image Cache?

Right now there appears to be no way to do this from the wantsSourceImageForEntity call.

If you use any of the NSURLSessionDownloadDelegate's they have their own delegate calls for progress and a final didFinishDownloadingToURL which gives the image from the Server. From this delegate you can Manually set the image just downloaded, but now you have no way to force retrieveImageForEntity to fire off to now load the just downloaded image.

The only way I can get progress to work is to basically download the same image twice, one in the wantsSourceImageForEntity with a downloadTaskWithRequest:completionHandler, and the other with a downloadTaskWithRequest and then using the NSURLSessionDownloadDelegate

  • (void)URLSession:(NSURLSession *)session
    downloadTask:(NSURLSessionDownloadTask *)downloadTask
    didWriteData:(int64_t)bytesWritten
    This works but it's not very good since your basically downloading the image twice.
    totalBytesWritten:(int64_t)totalBytesWritten
    totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants