RealmManager is a powerful wrapper to manage realm objects more easly.


Swift Package Manager

File > Swift Packages > Add Package Dependency Add Select “Branch” with “main”


  • Detach realm objects from realm.
  • Cascade deleting.
  • Cascade deleting object type and add new object with one function(replaceObject).
  • Reducing the number of code that needs to be written
  • Creates new instance for each call. You don’t need to be worry about threads ?


The default configuration is Realm.Configuration.defaultConfiguration with deleteRealmIfMigrationNeeded property true. So please be careful while using this manager. Your data maybe lost during development.

If you need to migrate your database scheme or disable auto delete the database, you have to do this only one time before using shared realm instance.

For example:

let myRealmConfiguration: Realm.Configuration

RealmManager.setup(configuration: myRealmConfiguration)


Thanks Roberto Frontado for detach realm objects.

Thanks Krzysztof Rodak for cascade deleting.


View Github