title: how to stop core animation?
body: <p>I am animating a button using core animation now on a certain condition I want to stop that animation how do I stop the animation?</p>
  
  <p>here is the method to animate the button</p>
  
  <pre><code>-(void)animateButton:(UIButton *)btnName
  {
      CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
      pulseAnimation.duration = .5;
      pulseAnimation.toValue = [NSNumber numberWithFloat:1.1];
      pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
      pulseAnimation.autoreverses = YES;
      pulseAnimation.repeatCount = FLT_MAX;
  
      [btnName.layer addAnimation:pulseAnimation forKey:nil];
  }
  </code></pre>