I have an app which requires downloading image asynchronously in base64 encoded string(server is returning the image in Base64 encoded format),I am using the AsyncImage view,but it seems that AsyncImageView library only accepts the url to download asynchronously.
Anyone having any idea how to go about this,if i will download all images at once an then i can pass that encoded string to
[self.imageView loadImageFromURL:[NSURL URLWithString:[EncodedString]]];
but this dosesn’t make sense as all the image will be downloaded still in UIThread.
Please help.
Thanks..!!
You should look into Cocoa Helpers – it has SimpleHTTPLoader for async loading and ImageViewCached which does exactly what you need. You create not imageView, but ImageViewCached and just set URL for it. It does the rest for you.
But if you want to do it your way:
I don’t guarantee that the code below is correct, but the whole idea is (i took it from working code and rewrote it to correspond your task. I used cocoa helpers for base64 decoding. You may use your own methods.
P.S. for base64-encoded images you’d have to modify ImageViewCached for it to load and decode images.