SwiftData provides a mechanism to periodically implicitly save a ModelContext to persistent storage.
This is an operation that could fail, as evidenced by the explicit save()
method being marked as throws
.
But what happens if the context attempts to save automatically, and that operation fails? Is there any mechanism for notifying the app? Any way for the app to recognize that it has happened, and to attempt to correct the situation? Presumably, it doesn't just crash (and lose the user's unsaved changes…).