Skip to content

Commit 00a786b

Browse files
committed
Fix for collection view scrolling not working in some tests
1 parent 4218eae commit 00a786b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/KIF/Additions/UIView-KIFAdditions.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,7 @@ - (UIAccessibilityElement *)accessibilityElementMatchingBlock:(BOOL(^)(UIAccessi
376376
}
377377

378378
@autoreleasepool {
379-
CGRect visibleRect = [collectionView layoutAttributesForItemAtIndexPath:indexPath].frame;
380-
[collectionView scrollRectToVisible:visibleRect animated:NO];
379+
[collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionNone animated:NO];
381380
[collectionView layoutIfNeeded];
382381
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
383382
NSAssert(cell, @"UICollectionViewCell returned from 'cellForItemAtIndexPath' is unexpectedly nil!");

0 commit comments

Comments
 (0)