Iglistkit: prepareForReuse vs cellForItem

Created on 1 Aug 2018  Â·  4Comments  Â·  Source: Instagram/IGListKit

Is it better to use UICollectionView's prepareForReuse method or ListSectionController's cellForItem method to reset some views state in cell?

question

Most helpful comment

If you are working with your model (item), ListSectionController's cellForItem is probably the better choice.

All 4 comments

If you are working with your model (item), ListSectionController's cellForItem is probably the better choice.

I want to manage the selection state of cells.

@Recouse can you give us an example of your setup and options? Either is probably ok. Typically for selection you’d set a property on the cell every time cellForItem is called, so that should take care of “resetting” the cells state.

Sent with GitHawk

Got it. Thank you for the answers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilCai1993 picture PhilCai1993  Â·  3Comments

drinkius picture drinkius  Â·  3Comments

rnystrom picture rnystrom  Â·  3Comments

jessesquires picture jessesquires  Â·  3Comments

lucabartoletti picture lucabartoletti  Â·  3Comments