# IGListDiffable

    @protocol IGListDiffable

The `IGListDiffable` protocol provides methods needed to compare the identity and equality of two objects.

- `-diffIdentifier`

  Returns a key that uniquely identifies the object.

  Note

  Two objects may share the same identifier, but are not equal. A common pattern is to use the `NSObject` 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

  Objective-C

      - (nonnull id<NSObject>)diffIdentifier;

  Swift

      func diffIdentifier() -> NSObjectProtocol

  #### Return Value

  A key that can be used to uniquely identify the object.

- `-isEqualToDiffableObject:`

  Returns whether the receiver and a given object are equal.

  #### Declaration

  Objective-C

      - (BOOL)isEqualToDiffableObject:(nullable id<IGListDiffable>)object;

  Swift

      func isEqual(toDiffableObject object: IGListDiffable?) -> Bool

  #### Parameters

  `object` | The object to be compared to the receiver.

  #### Return Value

  `YES` if the receiver and object are equal, otherwise `NO`.

© 2017 Instagram. All rights reserved. (Last updated: 2017-01-04)

Generated by jazzy ♪♫ v0.7.3, a Realm project.