Is there a way to move user data from UserDefaults to SwiftData when the app is in production so that people don’t lose their data. Currently my audio journals in my journal app has everything in the UserDefaults. Now this is bad for obvious reasons but I was thinking if there was a way. It’s only been 1 week since published and I have already had17 people download it.
UserDefaults to SwifData Migration
Recommended
if you’re asking if there’s an automatic way then no there isn’t but doing this should be pretty straightforward, check if the move has already been done when the app starts and if not load the data from UserDefaults and store it using your SwiftData models.