I have updated the Realm object in swift. I simply want to delete the schema and create a new one in case the app has the older version.
To achieve this I am using the following code:
lazy var realm = try! Realm(configuration:Realm.Configuration(deleteRealmIfMigrationNeeded: true))
But it results in SchemaMismatchException
at this particular line.
I have also tried this and code sample of this. But I get same error at the line of declaration of Realm object.
Can anybody give the working code of this?