I have a CoreData stack set up, able to retrieve the edit history for specific objects and so forth. I can even identify which property changed. However I'm struggling with getting the old and new value of the property. See my code below. Is this even possible? If so, how?
func apply(_ changeItem: NSPersistentHistoryChange) {
switch changeItem.changeType {
case .update:
guard let updatedProperties = changeItem.updatedProperties else { break }
updatedProperties.forEach { (property) in
// Get old and new value here
}
case .insert:
// ...
}
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With