Persisting SwiftData After App Deletion

Hello,

I've encountered an issue where SwiftData remains in the /Users/(username)/Library/Containers/MyApp directory even after my MacOS app has been deleted. This behavior is not what I expected.

Has anyone else faced this issue?

Also, I'm wondering if there is a delay in the deletion process that might account for this. is there a known time lag before everything is cleared out?

Thanks.

Replies

This thread might be helpful: https://developer.apple.com/forums/thread/653690

  • Thank you for your comment! I didn't know the app container remains after deletion, which could hinder fixing SwiftData bugs through reinstallation.(like iOS) Ideally, it should be bug-free from the start, but having a straightforward method to fully remove it upon deletion would also be beneficial.

  • I've also read this thread: https://forums.developer.apple.com/forums/thread/76891 (answered 6 year before) but it seems there no way to make "clear out" swiftdata when app deletion in macOS programmatically.

Add a Comment