Make explicit IGListDiffable protocol requirement

Summary:
While the CocoaDocs for the [IGListDiffable](https://instagram.github.io/IGListKit/Protocols/IGListDiffable.html) state that IGListDiffable objects should not mutate their `diffIdentifier` that requirement is not clear in this guide.

This is a documentation only PR.

Issue fixed: #880

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/881

Reviewed By: ryanolsonk

Differential Revision: D5547277

Pulled By: rnystrom

fbshipit-source-id: 68d6f18f9c5bbb28d2c7071b67e8f89624258d81
This commit is contained in:
Clay Reimann 2017-08-03 06:04:26 -07:00 committed by Facebook Github Bot
parent 7d33065b88
commit 85afdfa54b

View file

@ -80,6 +80,8 @@ The data should be immutable. If you return mutable objects that you will be edi
To add custom, diffable models, you need to conform to the `IGListDiffable` protocol and implement `diffIdentifier()` and `isEqual(toDiffableObject:)`.
> **Note:** an object's `diffIdentifier()` should never change. If an object mutates it's `diffIdentifer()` the behavior of IGListKit is undefined (and almost assuredly undesirable).
For an example, consider the following model:
```swift