Search code examples
iosswiftrealm

How To Programmatically Locate 'default.realm' File In An iOS App


Realm has now removed the defaultPath property from the Realm object. I am using this property in my code, and it is now being flagged as an error saying that the property does not exist. Is there another way to programmatically locate my app's default.realm file?


Solution

  • A Realm's various configuration options have been grouped together as Realm.Configuration. The default configuration is accessible as Realm.Configuration.defaultConfiguration, and its path is available via the path property.