My app typically works with very large image files. Having it auto-save on every change is very expensive as most formats cannot be saved incrementally.
Is there a way to disable this and force the user to use the Save menu item on OSX, and possibly a Save button on iOS?
SwiftUI document-based API, or DocumentGroup
+ FileDocument
/ ReferenceFileDocument
, doesn't provide a direct way for disabling auto-save, nor does it privide any good way for customizing the reading / writing process. I’d hence suggest that you file a feedback report with your use case to request the features – If you do so, please share your report ID here for folks to track.
When you use FileDocument
, auto-save is triggered after the system detects a change on the document; for ReferenceFileDocument
, auto-save is tied to a registration on the undo manager. If really needed, you might be able to control the save timing by deferring your change on the document or undo stack.
To handle large files with a customized reading / writing process, you might consider using UIDocument
/ NSDocument
instead. The Synchronizing documents in the iCloud environment covers this topic.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.