mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-24 01:38:26 +00:00
Update User copy in readme to a real-world example
Summary: Copy changes. Can proof them here: https://github.com/Instagram/IGListKit/tree/readme I got some feedback that the `User` example didn't make sense (*why would you have two users with the same pk?*). - [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 have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/50 Reviewed By: jessesquires Differential Revision: D4006618 Pulled By: rnystrom fbshipit-source-id: 9673788b643785d223b67ab1b23315edfc5874cb
This commit is contained in:
parent
a2e0005357
commit
6e3656449f
1 changed files with 6 additions and 1 deletions
|
|
@ -120,10 +120,15 @@ class User {
|
|||
|
||||
The user's `primaryKey` uniquely identifies user data, and the `name` is just the value for that user.
|
||||
|
||||
Consider the following two users:
|
||||
Let's say a server returns a `User` object that looks like this:
|
||||
|
||||
```swift
|
||||
let shayne = User(primaryKey: 2, name: "Shayne")
|
||||
```
|
||||
|
||||
But sometime after the client receives `shayne`, someone changes their name:
|
||||
|
||||
```swift
|
||||
let ann = User(primaryKey: 2, name: "Ann")
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue