Instagram / IGListKit

A data-driven UICollectionView framework for building fast and flexible lists.
https://instagram.github.io/IGListKit/
MIT License
12.83k stars 1.54k forks source link

Pull to refresh #1346

Open adelbios opened 4 years ago

adelbios commented 4 years ago

hi, I trying to implement pull to refresh , but i got this error Duplicate identifier 3 for object LegacyProject.ExplorationModel with object LegacyProject.ExplorationModel' How i can fix that

Bruce-pac commented 4 years ago

ListDiffable->diffIdentifier(),your implementation of this method may be wrong.

adelbios commented 4 years ago

@Bruce-pac can . you provide demo example ?!

adelbios commented 4 years ago

Any help ?!

Bruce-pac commented 4 years ago

What is your implementation of this method?

adelbios commented 4 years ago

Just i call api agin , and append data Ex: fetchRepoAPI()

Bruce-pac commented 4 years ago

you can see my demo OC or Swift

adelbios commented 4 years ago

I am grateful to you

adelbios commented 4 years ago

@Bruce-pac nice demo but pull to refresh isn’t work do you have an example to help me ?!

koenpunt commented 4 years ago

You should probably replace the data in your datasource instead of appending it, because if it's a refresh, it's probably expected to get the same ids, and then depending on the implementation of the diffIdentifier, you would also get the same identifiers, causing the "duplicate identifier" assertion.