title: How to add a fullscreen subview to the current UIWindow in objective c which will change according to the device orientation?
body: <p>I want to add a temporary view over the current presented viewcontroller which covers the entire screen.After some research I found that I should add this screen as a subview of current UIWindow.I used the following code.But the view is not covering the entire screen.</p>
  
  <pre><code>`UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
  //mainWindow.frame=self.view.frame;
  _autoPlayViewBackground.frame=self.view.frame;
  _autoPlayViewBackground.hidden=NO;
  [mainWindow addSubview:_autoPlayViewBackground];` 
  </code></pre>
  
  <p>This code is giving a window towards a side.Any help would be a great help.</p>