I want to do several animations
in series within a loop. Each animation
does "UI animation" first followed by "completion block". My question is how to add several such animations
in series within a loop so that the executing sequence follows: conditon->"UI animation 1" -> "completion block 1" -> condition-> "UI animation 2" -> "completion block 2" ->...-> condition->"UI animation n" -> "completion block n".
while(condition){
[UIView animateWithDuration:0.3 animations:^{
//UI animation
CGRect frame = sourceView.frame;
frame.origin = destPosition;
view.frame = frame;
} completion:^(BOOL finished) {
//completion block
self.currentBoard = destBoard;
}];
}
sorry, I may not present my question clearly. I have updated my question as above, a while loop is added. The issue is that I find next condition test is executed before the completion block of previous animation