Change realm file without restarting app -


i'm using realm icloud document, question:

how can change realm file without restarting app when icloud document changes?

you should never change realm file while opened realm object. end in unknown side effects.

so recommend export realm file whenever makes sense. file synced via icloud , monitored changes - import changes.

exporting method explained docs: https://realm.io/docs/swift/latest/api/classes/realm.html#/s:fc10realmswift5realm15writecopytopathfs0_ftss13encryptionkeygsqcso6nsdata__gsqcso7nserror_

if realm file larger there disadvantage: icloud sync whole file smaller changes.

in short: feels complicated implement clean, conflict free syncing solution using realm , icloud. maybe should think using cloudkit or simelar backend service realize data syncing: https://developer.apple.com/library/ios/documentation/datamanagement/conceptual/cloudkitquickstart/introduction/introduction.html


Comments