I'm trying start another animation when one ends.
I am checking for callbacks like this:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(animationDidStopNotification:)
name:ImageAnimatorDidStopNotification
object:animatorViewController];
How do I make an if statement that lets me do trigger something when ImageAnimatorDidStopNotification is received?
Thanks!
You didn't post enough code to know what are you trying to do and where is the problem.
If you want to chain two (or more) animations with UIKit, try using
setAnimationDidStopSelector:
selector.Chaining animations together using
animationDidStop
is useful for very simple scenarios. However, for anything more complex, it quickly becomes unwieldy.A much nicer approach as recommended by Apple, is to take advantage of the
CAMediaTiming
protocol.They give a great example in the WWDC 2011 videos in Session 421 "Core Animation Essentials". You'll find that in the link above. You will need a developer account to access that.
Fast forward in the video to 42:36 for the "Notifications and Timing" Tip.