Can I use iOS Realm Databases with App Groups?
1 answer
To share Realms between apps in the same iOS app group, you need to provide a shared location for Realm:
let fileURL = FileManager.default
.containerURL(forSecurityApplicationGroupIdentifier: "group.io.realm.app_group")!
.appendingPathComponent("default.realm")
let config = Realm.Configuration(fileURL: fileURL)
let realm = try Realm(configuration: config)
+3
source to share