I created a custom operator to change the value only when it's different :
func ?!=<T:Equatable> (inout lhs:T?, rhs:T?) {
if lhs != rhs {
lhs = rhs
}
}
I used it like that :
eventMO.id ?!= eventObject.id
In my NSFetchedResultsControllerDelegate
controller(_:didChangeObject:atIndexPath:forChangeType:newIndexPath:)
returns NSFetchedResultsChangeType.Move
there should be actually nothing when the value is the same.
I tested with the debugger, and the left hand parameter doesn't get modified in my test case.
So I'm guessing : Does an inout operator trigger a change on a NSManagedObject
?