title: Attempt to present vc whose view is not in the window hierarchy
body: <p>I'm trying to open file in thread and here is my code:</p>
  
  <pre><code>DispatchQueue.main.async(execute: { () -&gt; Void in
      var documentsURL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)).appendPathComponent(“File.pdf")
      self.docController = UIDocumentInteractionController.init(url: documentsURL as URL)
      self.docController?.delegate = self as? UIDocumentInteractionControllerDelegate
      self.docController?.presentPreview(animated: true)
      self.docController?.presentOpenInMenu(from: CGRect.zero, in: self.view, animated: true)
  })
  </code></pre>
  
  <p>when move to main screen this warning is displayed and file not open</p>
  
  <pre><code>Warning: Attempt to present &lt;_UIDocumentActivityViewController: 0x...&gt; on &lt;HCM.PrintVacationDecisionVC: 0x...&gt; whose view is not in the window hierarchy! 
  </code></pre>
  
  <p>Any help to solve this problem?</p>