title: iOS dim background View full screen
body: <p>My question should be simple but I couldn't find solution.</p>
  
  <p>I am displaying modal VC and I want to append dim background view.</p>
  
  <p>Modal VC is added as a child to the parent VC. Parent VC is placed at top of Navigation Controller (<code>topViewController</code>)</p>
  
  <p>Dim view is added to the <code>UIScreen.windows.first!</code> window. But the dim view doesn't fill the whole screen. I do set frame for it with <code>CGPointZero</code> for origin, I tried negative y value it didn't help. It just look like this.
  Also I added set of auto layout constraints, set to false/true <code>translatesAutoresizingMaskIntoConstraints</code> property, changed <code>clipToBounds</code>.</p>
  
  <p>Nothing helps, the dim view doesn't cover entire screen.</p>
  
  <p><a href="https://i.stack.imgur.com/gkEbg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gkEbg.jpg" alt="Wrong display of dim view"></a></p>
  
  <p>I can display the dim view in full screen, if I don't add modal VC as a child, i.e. I directly utilize modal VC's view, and add it to the <code>window</code>. It looks fine, but there is another bug. That's why I am adding modal VC, as a child VC.
  How to force dim view display the whole screen.</p>
  
  <p>In the app there might be several modal VC displayed simultaneously, that's why seques, (i.e presentation of VCs) is not the best choice.</p>
  
  <p><a href="https://i.stack.imgur.com/Lv3v4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lv3v4.jpg" alt="enter image description here"></a></p>
  
  <p>P.S. Here is description of the bug :</p>
  
  <p>. In case of adding modal VC (UITableVC placed into Nav. Controller)'s view directly to the window , view displays shifted table, after returning back from BG, i.e. in case of being in BG and starting to display modal VC from BG, after that switching back to Foreground, part of table's header (Question is revealed part) is shifted up and modal VC's navigation bar is expanded, i.e. they intersect, header of the table isn't display completely. I couldn't fix that. </p>