I need to remove objects from scope during migration.
I have an AccountManager that contains:
func logOut() { let realm = try! Realm() try! realm.write { realm.delete(realm.objects(Account.self)) realm.delete(realm.objects(Address.self)) ...
But whenever I use the logOut () function in a migration block, it just fails.
let config = Realm.Configuration( schemaVersion: 11, migrationBlock: { migration, oldSchemaVersion in if (oldSchemaVersion < 11) {
I need users to reboot after this update. Is there any way to perform these deletions in the migration block?
source share