Skip to content

Fast Image Cache with progress indicator #119

Description

@pmurphyjam

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions