title: iOS: Issues with creating another UIWindow as an overlay (iOS 7 issues?)
body: <p>I want to create an overlay view above all other views (including the keyboard), and creating another UIWindow seems to be the way to do this. After reading through <a href="https://developer.apple.com/library/ios/documentation/windowsviews/conceptual/viewpg_iphoneos/CreatingWindows/CreatingWindows.html#//apple_ref/doc/uid/TP40009503-CH4-SW1" rel="nofollow">the Windows section of the View Programming Guide</a> and some other documents online, it seems like I just need to...</p>
  
  <ul>
  <li>create the window with the screen bounds,</li>
  <li>set its <code>windowLevel</code> to <code>UIWindowLevelStatusBar</code>,</li>
  <li>set <code>userInteractionEnabled</code> to <code>NO</code> (so it would ignore touches),</li>
  <li>and make it visible by setting its <code>hidden</code> property to <code>NO</code> (without making it the key window, so it does not receive non-touch events).</li>
  </ul>
  
  <p>Here's the code in my app delegate:</p>
  
  <pre><code>self.overlayWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.overlayWindow.backgroundColor = [UIColor clearColor];
  self.overlayWindow.windowLevel = UIWindowLevelStatusBar;
  self.overlayWindow.userInteractionEnabled = NO;
  self.overlayWindow.rootViewController = [[OverlayViewController alloc] initWithNibName:nil bundle:nil];
  self.overlayWindow.hidden = NO;
  </code></pre>
  
  <p>However, I ran into a few issues:</p>
  
  <ol>
  <li><code>[self.overlayWindow.rootViewController preferredStatusBarStyle]</code> is setting the status bar text color when I actually want the root view controller of my original window to be doing this.</li>
  <li>A big issue is that the extra window is somehow messing up my handling of the software keyboard notifications. It seems like I still get the notifications, but my app is responding strangely in some instances. (I won't explain what these strange behaviors are because they are beside the point.) The point is that I shouldn't be getting these strange behaviors at all: I'm just trying to paint an overlay over the app, and the app should behave just as it did before.</li>
  <li>I would like the rotations from <code>overlayWindow</code> to match up to those of my original window, but it is rotating independently. For example, the swipe-to-go-back gesture of UINavigationController locks the interface orientation, but <code>overlayWindow</code> is still able to rotate during this.</li>
  </ol>
  
  <p>What should I do to fix this, so I just get a harmless overlay over the app?</p>