Skip to content

Commit

Permalink
Dont assert indexForCell: API when cell isnt visible
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Nystrom committed Jun 22, 2017
1 parent 895de47 commit 58c9c0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/IGListAdapter.m
Expand Up @@ -726,7 +726,8 @@ - (NSInteger)indexForCell:(UICollectionViewCell *)cell sectionController:(nonnul
IGParameterAssert(cell != nil);
IGParameterAssert(sectionController != nil);
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
IGAssert(indexPath.section == [self sectionForSectionController:sectionController],
IGAssert(indexPath == nil
|| indexPath.section == [self sectionForSectionController:sectionController],
@"Requesting a cell from another section controller is not allowed.");
return indexPath != nil ? indexPath.item : NSNotFound;
}
Expand Down

0 comments on commit 58c9c0e

Please sign in to comment.