I have a object Person with many dogs. App has separate page where it shows just dogs and other page where it shows person\'s dogs
My model is as follows
<
We don't need TiM's method anymore.
Use add(_:update:).
try realm.write {
realm.add(objects, update: Realm.UpdatePolicy.modified)
// OR
realm.add(object, update: .modified)
}
Realm.UpdatePolicy enums:
error (default)
modified //Overwrite only properties in the existing object which are different from the new values.
all //Overwrite all properties in the existing object with the new values, even if they have not changed
NB: Works on Realm Swift 3.16.1