Skip to content

Commit

Permalink
add assert when missing a reuseIdentifier
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Maxime Ollivier authored and facebook-github-bot committed May 2, 2024
1 parent 63d41af commit cff863b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/IGListKit/Internal/IGListAdapter+UICollectionView.m
Expand Up @@ -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];
Expand Down

0 comments on commit cff863b

Please sign in to comment.