Replace incorrect IGListSectionController dequeue calls

Summary:
Some calls to cellForItemAtIndex: on IGListSectionController expect this method to return a reference to an existing, already dequeued cell. It doesn't do this - it dequeues a new cell instance and returns that.

Added a warning note to the docs.

Reviewed By: lorixx

Differential Revision: D13222395

fbshipit-source-id: bb7a80f9f005e2675eef3d01a236a5f9f0008b46
This commit is contained in:
Jordan Smith 2018-11-29 08:25:06 -08:00 committed by Facebook Github Bot
parent f743df8a0e
commit b9486a104c

View file

@ -57,6 +57,10 @@ NS_SWIFT_NAME(ListSectionController)
will be used on screen. You should never allocate new cells in this method, instead use the provided adapter to call
one of the dequeue methods on the IGListCollectionContext. The default implementation will assert. **You must override
this method without calling super.**
@warning Don't call this method to obtain a reference to currently dequeued cells: a new cell will be dequeued
and returned, rather than the existing cell that you may have intended to retrieve. Instead, you can call
`-cellForItemAtIndex:sectionController:` on `IGListCollectionContext` to obtain active cell references.
*/
- (__kindof UICollectionViewCell *)cellForItemAtIndex:(NSInteger)index;