From cff863b0b66e684d7a1666903cacf6ca105f802c Mon Sep 17 00:00:00 2001 From: Maxime Ollivier Date: Thu, 2 May 2024 08:24:12 -0700 Subject: [PATCH] add assert when missing a reuseIdentifier Summary: A cell without a reuseIdentifier will crash, but it'll be hard to debug which section-controller did it. Lets add an assert Differential Revision: D56883578 fbshipit-source-id: 2f5a27d5f0a73f263eb58a14114edd607095cd4d --- Source/IGListKit/Internal/IGListAdapter+UICollectionView.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m b/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m index a2333fd8b..3b90857ec 100644 --- a/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m +++ b/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m @@ -50,6 +50,9 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell _isDequeuingCell = NO; IGAssert(cell != nil, @"Returned a nil cell at indexPath <%@> from section controller: <%@>", indexPath, sectionController); + if (cell) { + IGAssert(cell.reuseIdentifier != nil, @"Returned a cell without a reuseIdentifier at indexPath <%@> from section controller: <%@>", indexPath, sectionController); + } // associate the section controller with the cell so that we know which section controller is using it [self mapView:cell toSectionController:sectionController];