title: Cannot open file from iOS Files app via the Open In <My App> share sheet: no file at the provided file URL exists
body: <p>My iOS app can open CSV files, in order to import their data. I can open files from within the app via a <code>UIDocumentPickerViewController</code> with no issues, selecting a file shown in the Files app. However, when viewing a file in the Files app first, and then opening my app from there (via the Open In share sheet), my app cannot see the file at the URL passed to my app. The file does not seem to exist.</p>
  
  <p>I added the following debug code to my AppDelegate:</p>
  
  <pre><code>func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -&gt; Bool {
      print("Exists: \(FileManager.default.fileExists(atPath: url.path)) (\(url.path))")
      return true
  }
  </code></pre>
  
  <p>When I open a file from Files in this app, it results in a log line like:</p>
  
  <blockquote>
    <p>Exists: false (<code>/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Reading List - Andrew’s iPhone - 2018-10-18 11-19.csv</code>)</p>
  </blockquote>
  
  <p>When I open a file from some other app (e.g. Dropbox, or from an Email), the file <em>can</em> be processed, and the following is logged:</p>
  
  <blockquote>
    <p>Exists: true (<code>/private/var/mobile/Containers/Data/Application/F9110F90-7A91-4AB6-A92E-0ED933184EA4/Documents/Inbox/Reading List - Andrew’s iPhone - 2018-01-27 08-03.csv</code>)</p>
  </blockquote>
  
  <p>Note the different path (<code>Documents/Inbox</code> vs <code>Mobile Documents/com~apple~CloudDocs</code>). What is causing this? How can I support the opening of files from the Files app in my app?</p>
  
  <p>The document type(s) supported by my app are as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/zfhEz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zfhEz.png" alt="Xcode document types"></a></p>