Answer the question
In order to leave comments, you need to log in
How to backup Realm database to a file in Swift?
How to save the Realm DB to a file, ideally with a custom extension?
How to replace the current database with such a backup?
I initialize the database like this:
let fileURL = FileManager.default
.containerURL(forSecurityApplicationGroupIdentifier: self.identificator)!
.appendingPathComponent("default.realm")
let config = Realm.Configuration(fileURL: fileURL, schemaVersion: 2, migrationBlock: { (migration, oldSchemaVersion) in })
let realm = try! Realm(configuration: config)
Answer the question
In order to leave comments, you need to log in
If the Realm URL looks like this:
FileManager.default
.containerURL(forSecurityApplicationGroupIdentifier: self.identificator)!
.appendingPathComponent("default.realm")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question