nicklockwood / AsyncImageView

[DEPRECATED]
http://charcoaldesign.co.uk/source/cocoa#asyncimageview
Other
906 stars 186 forks source link

Not an ISSUE but a question about setting the .image property #10

Closed acabrera2012 closed 12 years ago

acabrera2012 commented 12 years ago

I am using AsyncImageView with iCarousel and ReflectionView but I'm not sure of the best place within AsyncImageView to set the .image property (which appears to be necessary to get the reflection eventhough the image has already been downloaded from a remote URL). processDataInBackground seems like a good place but I must be missing something since it's not working for me.

nicklockwood commented 12 years ago

AsyncImageView doesn't draw a reflection by itself, so I assume you're using it in conjunction with ReflectionView?

The problem is not that you need to set the .image property, as the AsyncimageView already does this internally once the image has downloaded. The problem is that you need to know when the image is set so you can call update on the ReflectionView.

The easiest way to do that is to use KVO to observe when the image property of the AsyncImageView changes. You may wish to wrap the AsyncimageView and ReflectionView up in another custom item view class to simplify managing multiple observers.

acabrera2012 commented 12 years ago

Ok, thanks. I'll take a look at the KVO route. That seems like the right way to tackle it. Thanks.