File tree 1 file changed +5
-0
lines changed
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
380
380
[collectionView scrollRectToVisible: visibleRect animated: NO ];
381
381
[collectionView layoutIfNeeded ];
382
382
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
+ }
383
388
NSAssert (cell, @" UICollectionViewCell returned from 'cellForItemAtIndexPath' is unexpectedly nil!" );
384
389
UIAccessibilityElement *element = [cell accessibilityElementMatchingBlock: matchBlock notHidden: NO disableScroll: NO ];
385
390
You can’t perform that action at this time.
0 commit comments