From b9486a104c4dbb943c6e546d800dd6cc4adfcb15 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Thu, 29 Nov 2018 08:25:06 -0800 Subject: [PATCH] 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 --- Source/IGListSectionController.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/IGListSectionController.h b/Source/IGListSectionController.h index 258972a0..a3353f00 100644 --- a/Source/IGListSectionController.h +++ b/Source/IGListSectionController.h @@ -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;