I haven't looked into CloudKit all that much, but I think you are looking for NSMetadataQuery...(if you have 'iCloud Documents' checked off in your App's Capabilities).
For Cloudkit, you get a CloudKit database (public/private), you can use to store any data you want in it, I guess you would have to build your app to store documents in the CloudKit database...but it doesn't sound like that is what you want?
If you are trying to show existing contents that is in iCloud Drive in your app, you need to use NSMetadataQuery on iOS. It is kind of tricky to work with. You also can use UIDocumentPickerViewController.
Thanks for your response.
Yes, my app is not intented to store documents in the CloudKit database. Actually I trying to build an app on tvos to show existing contents that is in iCloud Drive. I tried using UIDocumentPickerViewController but it seems unavailable on tvos. I am getting following error.
---->UIDocumentPickerViewController is unavailable : Not available on tvos
Any other suggestions?
>show existing contents that is in iCloud Drive
Your app can only access the content on CloudKit that your app placed there.