title: Find UIAlertView without having reference to it iOS 7
body: <p>I was using a code snippet in my project answered here: <a href="https://stackoverflow.com/questions/7579821/find-uialertview-without-having-reference-to-it">UIAlertView without having reference to it</a></p>
  
  <p>Here's the code:</p>
  
  <pre><code>+ (UIAlertView *) getUIAlertViewIfShown {
      if ([[[UIApplication sharedApplication] windows] count] == 1) {
          return nil;
      }
  
      UIWindow *window = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
      if ([window.subviews count] &gt; 0) {
          UIView *view = [window.subviews objectAtIndex:0];
          if ([view isKindOfClass:[UIAlertView class]]) {
              return (UIAlertView *) view;
          }
      }
      return nil;
  }
  </code></pre>
  
  <p>Unfortunately its not working in iOS 7 and I'm unable to dismiss an alert view. While debugging I found that in the loop its showing that view is of class <code>UITransitionView</code>. Pretty confusing because I couldn't find any quick documentation for this view class.</p>
  
  <p>Any ideas how can I fix this problem?</p>