title: File types association with my app
body: <p>My app is capable exporting and importing txt files. <code>CFBundleDocumentTypes</code> and <code>UTExportedTypeDeclarations</code> in my <code>.plist</code> are as follows:</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;string&gt;Icon60@2x&lt;/string&gt;
              &lt;/array&gt;
              &lt;key&gt;CFBundleTypeName&lt;/key&gt;
              &lt;string&gt;CSV&lt;/string&gt;
              &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
              &lt;string&gt;Default&lt;/string&gt;
              &lt;key&gt;LSHandlerRank&lt;/key&gt;
              &lt;string&gt;Default&lt;/string&gt;
              &lt;key&gt;LSItemContentTypes&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;public.text&lt;/string&gt;
              &lt;/array&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  
  &lt;key&gt;UTExportedTypeDeclarations&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;CSV&lt;/string&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;csv&lt;/string&gt;
                  &lt;key&gt;public.mime-type&lt;/key&gt;
                  &lt;string&gt;application/myApp&lt;/string&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p>Exporting works as expected, no issues. Importing also works well, but only with files which are stored outside of <code>my app iCloud folder</code>, i.e. when I tap a .txt file from mail or generic iCloud folder I can see my app in <code>"Import with ..."</code> menu next to other apps. But when I tap exactly the same file from <code>my app folder on iCloud</code>, my app is not listed in <code>"Import with ..."</code> menu.</p>
  
  <p>To clarify what I mean by saying <code>my app folder on iCloud</code>. App has a functionality to export and save certain data on iCloud with the following function:</p>
  
  <pre><code>func autoExportToIcloudDrive(_ localFileURL:URL, fileNameST:String) {
          let iCloudDocumentsURL = FileManager.default.url(forUbiquityContainerIdentifier: nil)?.appendingPathComponent("Documents").appendingPathComponent("\(fileNameST).csv");
          if iCloudDocumentsURL != nil {
              let olderFileURL = iCloudDocumentsURL?.appendingPathComponent(fileNameST);
              if FileManager.default.fileExists(atPath: olderFileURL!.path) {
                  self.uniFunc.deleteFileAtPath(pathUrl: olderFileURL!);
              }
              do {
                  try FileManager.default.copyItem(at: localFileURL, to: iCloudDocumentsURL!);
              } catch {
                  let nserror = error as NSError;
                  fatalError("\(nserror), \(nserror.userInfo)");
              }
          }
      }
  </code></pre>
  
  <p>This creates app folder in iCloud drive and stores my file there. And when I tap on this file I cannot see my app in <code>"Import with ..."</code> menu. When I move file out of app folder my app appears in <code>"Import with ..."</code> menu. </p>
  
  <p>Is this an intended design and apps are not expected to "see" files in their own iCloud drive folders or I am missing some kind of additional file association in .plist file? </p>