UIView animations canceling each other <p>I have a problem when playing multiple UIView animation blocks.</p> <p>What I have is a game with a lot of buttons, when you press a button it spawns an UILabel which animates to the top of the screen where is gets "added" to the total point amount, this is done by using 3 nested blocks. This works well an lets me spawn as many point labels as possible with animations on them.</p> <pre><code> //setup the label UILabel *pointIndicator = [[UILabel alloc]initWithFrame:CGRectMake(button.button.frame.origin.x, button.button.frame.origin.y, 60, 30)]; pointIndicator.backgroundColor = [UIColor clearColor]; pointIndicator.font = [UIFont boldSystemFontOfSize:25]; pointIndicator.alpha = 0; pointIndicator.layer.shadowOffset = CGSizeMake(1.0f, 1.0f); pointIndicator.layer.shadowOpacity = 0.6; pointIndicator.layer.shadowRadius = 1; [pointIndicators addObject:pointIndicator]; [self.view addSubview:pointIndicator]; CGPoint scoreLabelPosition = [self.view convertPoint:self.totalScoreLabel.frame.origin fromView:self.totalScoreLabel.superview]; CGSize scoreLabelSize = [self.totalScoreLabel.text sizeWithFont:self.totalScoreLabel.font]; [UILabel animateWithDuration:0.3 delay:0 options:UIViewAnimationCurveEaseIn animations:^{ //Make label appear and move it above button CGRect frame = pointIndicator.frame; frame.origin.y -= 30; pointIndicator.frame = frame; pointIndicator.alpha = 1; }completion:^(BOOL finished){ [UILabel animateWithDuration:0.4 delay:0 options:UIViewAnimationCurveEaseInOut animations:^{ //Move the label next to the score label NSInteger YPosition = 0; if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad){ YPosition = 15; }else{ YPosition = 2; } CGRect frame = pointIndicator.frame; frame.origin.x = scoreLabelPosition.x + self.totalScoreLabel.frame.size.width/2 + scoreLabelSize.width/2 + 5; frame.origin.y = scoreLabelPosition.y - self.totalScoreLabel.frame.size.height/2 + YPosition; pointIndicator.frame = frame; }completion:^(BOOL finished){ [UILabel animateWithDuration:0.5 animations:^{ pointIndicator.alpha = 0; }completion:^(BOOL finished){ //Animate point label to increase a bit in size CABasicAnimation *pointAnim = [CABasicAnimation animationWithKeyPath:@"transform"]; pointAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; pointAnim.duration = 0.1; pointAnim.repeatCount = 1; pointAnim.autoreverses = YES; pointAnim.removedOnCompletion = YES; pointAnim.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.5, 1.5, 1.0)]; [self.totalScoreLabel.layer addAnimation:pointAnim forKey:nil]; [pointIndicator removeFromSuperview]; [pointIndicators removeObject:pointIndicator]; }]; }]; }]; </code></pre> <p>However, when the game is ended all the buttons animate out of the screen and an image view grows in size out of the middle, each are using 1 animation block.</p> <p>The problem is that if an UILabel is animating across the screen at the same time as the game ends it cancels the button animation AND the growing image animation. If no UILabels are spawned everything plays as it should. I tried to cancel and remove all the point labels before playing the other animations, but with no luck. It only seems to work if all the previous animations have been completed normally in advance. This is how I remove them:</p> <pre><code>for(UIView *pointView in pointIndicators){ [pointView.layer removeAllAnimations]; [pointView removeFromSuperview]; } [pointIndicators removeAllObjects]; [self.totalScoreLabel.layer removeAllAnimations]; </code></pre> <p>all the views which are animated are subviews of the same UIView. I noticed that if I make the point labels subviews of the buttons all the animations can play at the same time.</p> <p>I cant seem to figure out this behavior, is there some sort of conflict between the animations?</p>