views:

144

answers:

1

I was pretty sure I had seen discussions of this around the Net, but now I can't seem to find anything. The question is simple: is there a way to use for example CABasicAnimation to animate a property on an object that's not a ´CALayer´? (Say, the ´volume´ property on an ´AVAudioPlayer´.)

If not, is there a way to make it work other than subclassing ´CALayer´? Maybe some protocol to conform to?

EDIT: How about doing this on the iPhone OS?

+4  A: 

You can indeed do this. Your object must implement the NSAnimatablePropertyContainer protocol and return a valid CAAnimation object for each property you want to animate in the +defaultAnimationForKey: class method.

To answer your updated question, no, you can't do this on the iPhone at present as there is no NSAnimatablePropertyContainer protocol available in iPhone OS and you can't get an animator proxy object from other objects.

Rob Keniger
Thanks Rob! Now the follow-up question: is this possible on the iPhone OS?
Felixyz
I've updated my answer. In short, no.
Rob Keniger