title: How can I add UIView object to self.view.window in ios7?
body: <p>I'd like to add a dark view layer that covers the whole screen.</p>
  
  <p>In order to do that, I added <code>UIView</code> object to window property of <code>UIViewController</code> as shown below.I remember I was able to add a view to <code>window</code> like this in ios6. But, it doesn't work in ios7.</p>
  
  <p>How am I able to make it work?</p>
  
  <p>Thanks in advance!!</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIView *overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
  
      overlayView.backgroundColor = [UIColor blackColor];
      overlayView.alpha = 0.8;
  
      [self.view.window addSubview:overlayView];
  }
  </code></pre>