I want to save a PDF file in the iCloud Drive. The user should have access to the file over his iCloud Drive App.
At the moment I can save a file in the iCloud Drive but it is in a hidden directory.
struct DocumentsDirectory {
static let localDocumentsURL: NSURL? = FileManager.default.urls(for: FileManager.SearchPathDirectory.documentDirectory, in: .userDomainMask).last! as NSURL
static var url: NSURL? = FileManager.default.url(forUbiquityContainerIdentifier: nil)! as NSURL
static let iCloudDocumentsURL: NSURL? = url?.appendingPathComponent("Documents")! as! NSURL
}
With this code I get the hidden directory in the iCloud Drive (which is specific to my app).
Now my question is: can I save the file in the standard documents directory in the iCloud Drive? Or can I create a folder for the documents from my app, which the user can see?