0

Good day all,

Referring to https://github.com/nicklockwood/AsyncImageView

I have gone through their Wiki and examples as well, but i could not find a way to use their API with call backs.

This works fine

imageView.imageURL=[NSURL URLWithString:[singleChannel objectForKey:@"channelimage"]];

But i would like to handle image failure. Any snippets on how i can use their "loadImageWithURL" with call backs.

Any help is appreciated.

Veeru
  • 4,936
  • 2
  • 43
  • 61

1 Answers1

1

As stated on the main page you can listen for according notifications:

To detect when the image has finished loading, you can use NSNotificationCenter in conjunction with the AsyncImageLoadDidFinish notification, or you can use KVO (Key-Value Observation) to set up an observer on the UIImageView's image property. When the image has finished loading, the image will be set, and with KVO you can detect this and react accordingly.

There is a notification when the image has finished loading (AsyncImageLoadDidFinish) as well as when the image failed being loaded (AsyncImageLoadDidFail). So in your case just subscribe your observer for AsyncImageLoadDidFail notifications for your image view.

DAXaholic
  • 33,312
  • 6
  • 76
  • 74