File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,11 @@ - (UIAccessibilityElement *)accessibilityElementMatchingBlock:(BOOL(^)(UIAccessi
380380 [collectionView scrollRectToVisible: visibleRect animated: NO ];
381381 [collectionView layoutIfNeeded ];
382382 UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath: indexPath];
383+ if (cell == nil ) {
384+ [collectionView scrollToItemAtIndexPath: indexPath atScrollPosition: UICollectionViewScrollPositionNone animated: NO ];
385+ [collectionView layoutIfNeeded ];
386+ cell = [collectionView cellForItemAtIndexPath: indexPath];
387+ }
383388 NSAssert (cell, @" UICollectionViewCell returned from 'cellForItemAtIndexPath' is unexpectedly nil!" );
384389 UIAccessibilityElement *element = [cell accessibilityElementMatchingBlock: matchBlock notHidden: NO disableScroll: NO ];
385390
You can’t perform that action at this time.
0 commit comments