title: Create a shake animation for a UIAlertView
body: <p>I'm trying to make a <code>UIAlertView</code> shake. I already made the <code>alertView</code> to stay on button click, but the shake animation is not working. Here is what I have:</p>
  
  <pre><code>- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  {
      if (buttonIndex == 1) {
          self.direction = 1;
          self.shakes = 0;
          [self shake:aUIView];
      }
  }
  
  -(void)shake:(UIAlertView *)theOneYouWannaShake
  {
    [UIView animateWithDuration:0.03 animations:^ {
                                      theOneYouWannaShake.transform = CGAffineTransformMakeTranslation(5 * self.direction, 0);
                                    } 
                                    completion:^(BOOL finished) {
                                      if(self.shakes &gt;= 10) {
                                        theOneYouWannaShake.transform = CGAffineTransformIdentity;
                                        return;
                                      }
                                      self.shakes++;
                                      self.direction = self.direction * -1;
                                      [self shake:theOneYouWannaShake];
                                    }];
  }
  </code></pre>
  
  <p>I tried putting an <code>NSLog</code> in <code>- (void)shake...</code> and I got an output. So there must be something wrong with my code as to why the <code>alertView</code> isn't shaking.</p>