title: Rotating UIButton for 180 degrees and rotating it back
body: <p>I have <code>UIButton</code>, that i wish to rotate in one direction for 180 degrees, and back also for 180 degrees. I have been doing animations for a while using <code>CABasicAnimation</code>, but this time i wanted to do it with transforms. Here is the code that i have written:</p>
  
  <pre><code>- (IBAction)blurAction:(id)sender {
      if (self.blurActive) {
          [UIView animateWithDuration:0.1 animations:^{
              self.blurView.alpha = 0;
              self.blurButton.transform = CGAffineTransformMakeRotation(M_PI);
          } completion:^(BOOL finished) {
              self.blurActive = NO;
          }];
      }
      else {
          [UIView animateWithDuration:0.1 animations:^{
              self.blurView.alpha = 1;
              self.blurButton.transform = CGAffineTransformMakeRotation(-M_PI);
          } completion:^(BOOL finished) {
              self.blurActive = YES;
          }];
      }
  }
  </code></pre>
  
  <p>It works the first time, but second time i press the button, nothing happens. Can someone explain what I am doing wrong here?</p>