I’m using Xcode 12.4 and ran into this same issue. My document is a ReferenceFileDocument (don't know if that influences this bug). My app initially presented an editor screen via a sheet. Closing the sheet and then backing out to the document browser would trigger an immediate save. Then I switched the editor view to be displayed via a NavigationLink. Then, as you report, the save would only be triggered after 15 seconds. I have decided to switch back to using a sheet to present my editor.
Regarding the 15 seconds, that’s the normal delay that triggers a save after making an edit. Normally that’s OK while you are still editing a document. But yeah, the minute you close the document, it should trigger a save.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: