title: Swift - Warning: Attempt to present * on * while a presentation is in progress
body: <p>I can't switch to another view controller because of this error. I want to switch to another view controller after it successfully scan the QR code.</p>
  
  <pre class="lang-none prettyprint-override"><code>2015-01-27 17:59:16.093 *[5416:1860144] Warning: Attempt to present &lt;*.SuccessViewController: 0x144e38a20&gt; on &lt;*.MethodViewController: 0x144e2b960&gt; whose view is not in the window hierarchy!
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>@IBAction func btnQrCode(sender: AnyObject) { 
      reader.modalPresentationStyle = .FormSheet
      reader.delegate               = self
  
      reader.completionBlock = { (result: String?) in
      if result != nil {
          let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
  
          let successViewController = storyBoard.instantiateViewControllerWithIdentifier("successView") as SuccessViewController
          self.presentViewController(successViewController, animated:true, completion:nil)
  
      }
  
      presentViewController(reader, animated: true, completion: nil)
      }
  }
  </code></pre>
  
  <p>P.S: I'm using QRCodeReader plugin, <a href="https://github.com/yannickl/QRCodeReader.swift" rel="nofollow noreferrer">https://github.com/yannickl/QRCodeReader.swift</a>.</p>