IGListDiffable protocol provides methods needed to compare the identity and equality of two objects.
Returns a key that uniquely identifies the object.
Two objects may share the same identifier, but are not equal. A common pattern is to use the
NSObjectcategory for automatic conformance. However this means that objects will be identified on their pointer value so finding updates becomes impossible.
This value should never be mutated.
- (nonnull id<NSObject>)diffIdentifier;
func diffIdentifier() -> NSObjectProtocol
A key that can be used to uniquely identify the object.
Returns whether the receiver and a given object are equal.
- (BOOL)isEqualToDiffableObject:(nullable id<IGListDiffable>)object;
func isEqual(toDiffableObject object: ListDiffable?) -> Bool
The object to be compared to the receiver.
YESif the receiver and object are equal, otherwise