I'm building a document-based app using SwiftUI's DocumentGroup
with a ReferenceFileDocument.
Everything works well when documents are created in the "On My iPhone" directory — they save(After registering Undo action), even after renaming.
However, when I create a document inside iCloud Drive (by default it creates in iCloud Drive as iCloud sync is enabled in capabilities), the document:
✅ Saves properly before rename
❌ Stops saving changes after renaming the file (By taping the filename at the top of the screen When document is open(Using inline rename UI in the navigation bar))
This issue only occurs for iCloud Drive–based documents. The same rename flow works fine for locally stored documents.
How can i ensure the document continues saving properly in this case?