Does anyone have a nice working solution for getting the download progress when using the UIImageView+AFNetworking category and AFNetworking 3.0.
This category, which I did use for versions up till 3.0 has stopped working now.
Here is my own experimental version which sadly, for the moment, crashes randomly.
If you look at AFImageDownloader this, it is used by the UIImageView category to download images. In this class you
It returns a receipt which has a NSURLSessionDataTask *task property. NSURLSessionDataTask has different properties of how bytes download, expected bytes to receive etc. Perhaps you can use this and achieve your task.
You can achieve this by adding few lines in UIImageView+AFNetworking.h
Place this code at top of the file under the import statement
And you need to register the observer to track the bytes received by adding below line under the function
setImageWithURLRequest
at the positionAdd this new function at end.
Here is the modified version of AFNetworking 3.0 in which you can show a progress while loading image from server using UIImageView+AFNetworking category.
https://github.com/rushisangani/AFNetworking
Please replace following files with original AFNetworking files.
NOTE: If you update your pod then this will be removed.