-1

When I want to save a file to my App folder in iCloud, the save button is disabled, but it is enabled in other directories. Is there a way to enable it?

enter image description here

My code:

//...
let urls: [URL] = [fileURL]
documentPickerExporter = UIDocumentPickerViewController(forExporting: urls, asCopy: true)
documentPickerExporter.delegate = self
documentPickerExporter.allowsMultipleSelection = false
documentPickerExporter.modalPresentationStyle = .popover
    
present(documentPickerExporter, animated: true, completion: nil)

1 Answer 1

0

You don't need / use the document picker for this. Save the file directly into your Documents folder. If you are sharing your files, your Documents folder is the folder that iCloud Drive displays as your "folder in the cloud".

Sign up to request clarification or add additional context in comments.

5 Comments

After clicking share file > save to Files > ... If I choose any directory, the save button is enabled, but it is not if I choose my app folder directory in iCloud. Note: My app folder in local directory allows me to save the file ( the save button is enabled there).
That doesn't affect what I just said. If you have turned on UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace, the Files app's display of your "folder in the cloud" is your Documents folder. If you haven't there is no option to interact with your "folder in the cloud" because there is no "folder in the cloud".
My goal is to allow users to save file freely inside app folder in iCloud , in any subdirectory.. so why the save button is disabled there?
Did you add iCloud in Project Signing & Capabilities?
yes 1-iCloud Documents (check) 2- containers: container name (check)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.