Open oleksandr opened 10 years ago
What would you want to do if the image couldn't be retrieved?
This is probably a design flaw. Where the source image comes from isn't important, but the caller to FIC to retrieve an image should be notified if anything goes wrong.
I believe a recent pull request fixes the case where passing a nil
image to the delegate completion block does call the retrieval request completion block. So while there currently isn't any context to identify why the retrieval request wrong, you at least aren't left hanging anymore. Perhaps allowing the completion block to take a generic context pointer would let the source image provider pass back specific failure information to the caller.
Right, I don't care about the source but I need to handle the error case. Would be nice to extend the completion block with an extra error parameter which seems to be a common practice.
Hey there, I encountered the same issue, and saw that this commit had already solved my problem. Are you planning another cocoapods-version anytime soon? If so, that would be totes awesome.
Great job by the way, it's blazing fast!
Hey all ,
Is this enhancement done from library already? I need to handle the Network error scenario while fetching images , let me know how i can handle that plsss.
Thanks, Sundar
I've noticed in the following call chain:
[FICImageCache asynchronouslyRetrieveImageForEntity:withFormatName:completionBlock:] -> [delegate wantsSourceImageForEntity:withFormatName:completionBlock:] -> AFHTTPRequest operation -> completionBlock(image)
There's no way to report a network layer error up to an app level caller. Passing nil to completionBlock simply ignores the lookup of the block in the dictionary inside of the FastImageCache.
Is there any way to overcome this design constraint?