title: How to add view in UIWindow?
body: <p>I wanted to add a view in <code>UIWindow</code> with following code:</p>
  
  <pre><code> AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
   UIWindow *window = delegate.window;
   UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
   aView.backgroundColor = [UIColor blackColor];
   [window addSubview:aView];
  </code></pre>
  
  <p>This code didn't work. I wanted to clone property of UIAlertView. It will pop over top of everything when we call
  <code>[alertViewInstance show];</code> method.</p>
  
  <p><strong>Tried this as well:</strong></p>
  
  <pre><code>   UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
      UIWindow* window = [UIApplication sharedApplication].keyWindow;
  
      if (!window) {
          window = [[UIApplication sharedApplication].windows objectAtIndex:0];
      }
  
      [window addSubview:aView];
      [window bringSubviewToFront:aView];
  </code></pre>