How to write to iCloud storage

My app needs to be able to save/load various text files and I want them to be in a folder on iCloud. How can I do that? saveText(“Documents:xxx”) seems to write only to iPad local storage.

@tsukit I don’t think thats possible yet. You can write to the Codea Dropbox and then move it to the iCloud, but I haven’t found a way to write directly to the iCloud.

@tsukit this is something I’ve been planning for but it’s not in yet.

It’s not really possible to write to iCloud like a regular file system, as you need permission to extend the sandbox for each file you want to touch, which requires an iOS system UI for the user to use to choose the file.

One thing you could try is to put a Codea project into iCloud, then tap on that project in the Files.app to open it in Codea. Then use saveText("Project:XXX") to save the text file within the project which is in iCloud.

Thanks @dave1707 and @Simeon