title: How to get files/folders list out of our App container in the iCloud Drive by using the NSMetaDataQuery API?
body: <p>I know every App in iCloud Drive can be thought as a container. </p>
  
  <p>I want to know how to get files/folders list out of my App's container in the iCloud Drive by using the <code>NSMetadataQuery API</code>.</p>
  
  <p>I have tried to use <code>NSMetadataQuery</code> to search it by setting the scope in the <code>NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope</code>, but there is nothing response.</p>
  
  <p>There is an example in <a href="https://developer.apple.com/library/content/samplecode/ShapeEdit/Listings/ShapeEdit_DocumentEditor_ShapeDocument_swift.html#//apple_ref/doc/uid/TP40016100-ShapeEdit_DocumentEditor_ShapeDocument_swift-DontLinkElementID_15" rel="nofollow">ShapeEdit</a> but there is still nothing there when I change the scope to <code>NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope</code>.</p>
  
  <p>I want to get all files or folders out of my app in the iCloud Drive like using <code>UIDocumentPickerViewController</code> but don't want to have User Interface interactive like <code>UIDocumentPickerViewController</code>.</p>
  
  <p>Is <code>UIDocumentPickerViewController</code> the only way to access the iCloud Drive?</p>