title: How to present a modal atop the current view in Swift
body: <p>(Xcode6, iOS8, Swift, iPad)</p>
  
  <p>I am trying to create a classic Web-like modal view, where the outside of the dialog box is "grayed-out." To accomplish this, I've set the alpha value of the backgroundColor of the view for the modal to 0.5, like so:</p>
  
  <pre><code>self.view.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.5)
  </code></pre>
  
  <p>The only problem is that when the modal becomes full-screen, the presenting view is removed. (Ref <a href="https://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller">Transparent Modal View on Navigation Controller</a>).</p>
  
  <p>(A bit irritated at the concept here. Why remove the underlying view? A modal is, by definition, to appear atop other content. Once the underlying view is removed, it's not really a modal anymore. it's somewhere between a modal and a push transition. Wa wa wa... Anyway..)</p>
  
  <p>To prevent this from happening, I've set the <code>modalPresentationStyle</code> to <code>CurrentContext</code> in the <code>viewDidLoad</code> method of the parent controller, and in Storyboard... but no luck.</p>
  
  <pre><code>    self.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
      self.navigationController.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
  </code></pre>
  
  <p>How do I prevent the presenting view from being removed when the modal becomes full screen?</p>
  
  <p>tyvm.. more info below.</p>
  
  <p>Also in Storyboard, like so (Presentation: Current Context)</p>
  
  <p><img src="https://i.stack.imgur.com/QriL8.png" alt="enter image description here"></p>
  
  <p>Thx for your help... documentation below:</p>
  
  <p><img src="https://i.stack.imgur.com/IIfzG.png" alt="enter image description here"></p>