I had a UIView block-based animation that looks like this:
[UIView animateWithDuration:0.5
//sequential delays
delay:3.0 * (float)(index/25)
options:UIViewAnimationOptionCurveEaseOut
animations:^{
// set myself as delegate
[UIView setAnimationDelegate:self];
// when animation stared, play some sound
[UIView setAnimationWillStartSelector:@selector(playDrawCardSound)];
// some animation results here
}
completion:^(BOOL finished){
// this log will never be printed out.
NSLog(@"finished");
}];
So, the problem is that all animations are fine, but the completion handler never got called.
Also, the reason that I am using delegate is because animations block will not be delayed as animations. That being said, all the sounds are played at once (not like animations which have delays between them).
Anybody know how to let code in animations block actually get delayed? Thanks!