1

When an animation completes in C4 does the object post a notification? I see endedNormally by C4Sample and reachedEnd by C4Movie. If I ask a shape to animate how can I get called when it completes?

Update

Here's a link to a gist with the solution implemented: https://gist.github.com/drart/5693291

Adam Tindale
  • 1,239
  • 10
  • 26

1 Answers1

1

At the moment there is no notification at the end of an animation. Your best bet is to run a method at a given interval you know will be after the animation, like so:

obj.animationDuration = 1.0f;
obj.fillColor = C4RED;
[self runMethod:@"methodToRunAfterAnimationIsComplete"
     afterDelay:obj.animationDuration+.01f];
C4 - Travis
  • 4,502
  • 4
  • 31
  • 56
  • Thanks! This works nicely. Any chance that an animation completed notification might be added in the future? – Adam Tindale Jun 02 '13 at 10:55
  • Possibly. I would like to design a more thorough animation system for C4. Right now it takes advantage of implicit animations provided by the Core Animation framework, but it doesn't take advantage of other aspects like keyframe animations and better control. It would be awesome to have that kind of stuff in C4. – C4 - Travis Jun 04 '13 at 05:28