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:
// ...
}
// ...
}