title: Transparent view background turns black
body: <p>I want to make the view of a view controller semi-transparent. For that I have set the background color like this in the <code>viewDidLoad</code> method.</p>
  
  <pre><code>view.backgroundColor = UIColor(white: 0, alpha: 0.5)
  </code></pre>
  
  <p>When the view controller is presented, the background appears as I need it and then it turns black right away.</p>
  
  <p><a href="https://i.stack.imgur.com/CCiNQ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CCiNQ.gif" alt="enter image description here"></a></p>
  
  <p>Why is this happening?</p>
  
  <p>This is the code for showing the <code>PopupViewController</code>:</p>
  
  <pre><code>@IBAction func didTapShowButton(_ sender: UIButton) {
      let navController = UINavigationController(rootViewController: PopupViewController())
      present(navController, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>I uploaded a demo project <a href="https://www.dropbox.com/s/iri6nzmuts9afc3/NibViewDemo.zip?dl=0" rel="nofollow noreferrer">here</a> as well.</p>