title: How do I enable the iOS Files app to copy files into my app?
body: <p>I have an app which uses iCloud Drive to store plain text files and it is working well -- I can save files to iCloud Drive and my app's folder shows up correctly and the files I created are there and they can be copied out, shared, etc….</p>
  <p>I now want to enable the user to copy their own text files into my app folder using the Files app, but in the Files app the Move button is disabled whenever my app's folder is selected.</p>
  <p>I've added an entry to CFBundleTypes in my info.plist:</p>
  <pre><code>&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
  &lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt;
          &lt;array/&gt;
          &lt;key&gt;CFBundleTypeName&lt;/key&gt;
          &lt;string&gt;Text&lt;/string&gt;
          &lt;key&gt;LSHandlerRank&lt;/key&gt;
          &lt;string&gt;Alternate&lt;/string&gt;
          &lt;key&gt;LSItemContentTypes&lt;/key&gt;
          &lt;array&gt;
              &lt;string&gt;public.plain-text&lt;/string&gt;
          &lt;/array&gt;
      &lt;/dict&gt;
  &lt;/array&gt;
  </code></pre>
  <p>and enabled file sharing and opening in place:</p>
  <pre><code>&lt;key&gt;UIFileSharingEnabled&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;LSSupportsOpeningDocumentsInPlace&lt;/key&gt;
  &lt;true/&gt;
  </code></pre>
  <p>but that didn't make any difference. I've also tried adding an import declaration like this:</p>
  <pre><code>&lt;key&gt;UTImportedTypeDeclarations&lt;/key&gt;
  &lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;UTTypeConformsTo&lt;/key&gt;
          &lt;array&gt;
              &lt;string&gt;public.text&lt;/string&gt;
          &lt;/array&gt;
          &lt;key&gt;UTTypeDescription&lt;/key&gt;
          &lt;string&gt;Text file&lt;/string&gt;
          &lt;key&gt;UTTypeIconFiles&lt;/key&gt;
          &lt;array/&gt;
          &lt;key&gt;UTTypeIdentifier&lt;/key&gt;
          &lt;string&gt;public.text&lt;/string&gt;
          &lt;key&gt;UTTypeTagSpecification&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;public.filename-extension&lt;/key&gt;
              &lt;string&gt;txt&lt;/string&gt;
              &lt;key&gt;public.mime-type&lt;/key&gt;
              &lt;string&gt;text/plain&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/array&gt;
  </code></pre>
  <p>But that did not help either, even after restarting the iPhone. The Files app Move button turns gray whenever my app's folder is selected.</p>
  <p>I suspect I might be on the wrong track and that this is really some sort of permissions problem, but I haven't seen anything about permissions in Apple's docs, just stuff about file types. On my Mac the folder shows up fine and I can drag files into it without any problem and my app recognizes them like it should. Only the iOS Files app won't save to my folder.</p>
  <p>Does anyone have insight into how to enable copying text files into my app's folder in the Files app, or what might cause the Files app to refuse to move files in there?</p>