Skip to content

Commit

Permalink
Merge pull request #1313 from kif-framework/markj/collection_view_rem…
Browse files Browse the repository at this point in the history
…ove_assert

Skip cells that can’t be found
  • Loading branch information
mjohnson12 authored Dec 2, 2024
2 parents be806f7 + d8b6ef6 commit 9ce238a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/KIF/Additions/UIView-KIFAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ - (UIAccessibilityElement *)accessibilityElementMatchingBlock:(BOOL(^)(UIAccessi
[collectionView layoutIfNeeded];
cell = [collectionView cellForItemAtIndexPath:indexPath];
}
NSAssert(cell, @"UICollectionViewCell returned from 'cellForItemAtIndexPath' is unexpectedly nil!");
// Skip this cell if it can't be found
if (!cell) {
continue;
}
UIAccessibilityElement *element = [cell accessibilityElementMatchingBlock:matchBlock notHidden:NO disableScroll:NO];

// Skip this cell if it isn't the one we're looking for
Expand Down

0 comments on commit 9ce238a

Please sign in to comment.