diff --git a/Additions/UIView-KIFAdditions.m b/Additions/UIView-KIFAdditions.m index 49baf0c40..4aab8e1d7 100644 --- a/Additions/UIView-KIFAdditions.m +++ b/Additions/UIView-KIFAdditions.m @@ -319,6 +319,11 @@ - (UIAccessibilityElement *)accessibilityElementMatchingBlock:(BOOL(^)(UIAccessi @autoreleasepool { // Get the cell directly from the dataSource because UICollectionView will only vend visible cells UICollectionViewCell *cell = [collectionView.dataSource collectionView:collectionView cellForItemAtIndexPath:indexPath]; + + // The cell contents might change just prior to being displayed, so we simulate the cell appearing onscreen + if ([collectionView.delegate respondsToSelector:@selector(collectionView:willDisplayCell:forItemAtIndexPath:)]) { + [collectionView.delegate collectionView:collectionView willDisplayCell:cell forItemAtIndexPath:indexPath]; + } UIAccessibilityElement *element = [cell accessibilityElementMatchingBlock:matchBlock notHidden:NO];