iCloudDocumentSync icon indicating copy to clipboard operation
iCloudDocumentSync copied to clipboard

iCloudDocument and autosave

Open audulus opened this issue 10 years ago • 2 comments
trafficstars

One of the nice things about UIDocument is that it auto-saves automatically at appropriate times (see https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocument_Class/#//apple_ref/occ/instm/UIDocument/autosaveWithCompletionHandler:).

iCloudDocumentSync uses its own UIDocument subclass, iCloudDocument, which seems to negate this advantage. iCloudDocument just stores the document data and it's up to the app to update that data at appropriate times. Constantly updating the NSData may work for trivial data, but will not scale to more complex data which may take time to generate.

audulus avatar Sep 01 '15 18:09 audulus

That is a good point, indeed. Although I'm not sure how easily the project could be changed to implement this -- sounds like a lot of refactoring would need to be done. Any ideas?

Sam-Spencer avatar Sep 01 '15 22:09 Sam-Spencer

It think allowing the user to have their own UIDocument subclass would cover both the autosave and file package issues. I don't think UIDocument subclass methods need to know anything about iCloud (this is the case in my app).

audulus avatar Sep 01 '15 22:09 audulus