Diffable
@objc(PESDKDiffable)
public protocol Diffable : AnyObject
The Diffable
protocol provides methods needed to compare the identity and equality of two objects.
-
A key that can be used to uniquely identify the object.
Note
Two objects may share the same identifier, but are not equal. A common pattern is to use theNSObject
category for automatic conformance. However this means that objects will be identified on their pointer value so finding updates becomes impossible.Warning
This value should never be mutated.Declaration
Swift
var diffIdentifier: NSObjectProtocol { get }
-
Returns whether the receiver and a given object are equal.
Declaration
Swift
func isEqual(toDiffableObject object: Diffable?) -> Bool
Parameters
object
The object to be compared to the receiver.
Return Value
true
if the receiver and object are equal, otherwisefalse
.