Archive for June 3, 2021

Migrating a SwiftUI iOS App from Core Data to Realm

I’ve just released a new article—Migrating a SwiftUI iOS App from Core Data to Realm.

Porting an app that’s using Core Data to Realm is very simple. If you have an app that already uses Core Data, and have been considering the move to Realm, this step-by-step guide is for you! The way that your code interacts with Core Data and Realm is very different depending on whether your app is based on SwiftUI or UIKit—this guide assumes SwiftUI (a UIKit version will come soon.)

You’re far from the first developer to port your app from Core Data to Realm, and we’ve been told many times that it can be done in a matter of hours. Both databases handle your data as objects, so migration is usually very straightforward: Simply take your existing Core Data code and refactor it to use the Realm SDK.

After migrating, you should be thrilled with the ease of use, speed, and stability that Realm can bring to your apps. Add in MongoDB Realm Sync and you can share the same data between iOS, Android, desktop, and web apps.