Balázs Vincze
Balázs Vincze

Reputation: 3832

Animating scroll in UICollectionView - iOS 10

I am programatically scrolling my collection view. It works perfectly on every iOS version except for iOS 10. The collection view scrolls without animation, it just snaps into place.

Is this a bug or I should be doing something differently in iOS 10?

Here is my code:

NSArray *visibleItems = [collectionViewReference indexPathsForVisibleItems];
NSIndexPath *currentItem = [visibleItems objectAtIndex:0];
NSIndexPath *previousItem = [NSIndexPath indexPathForItem:currentItem.item - 1 inSection:currentItem.section];
[collectionViewReference scrollToItemAtIndexPath:previousItem atScrollPosition:UICollectionViewScrollPositionRight animated:YES];

Upvotes: 2

Views: 539

Answers (1)

Bogdan Evsenev
Bogdan Evsenev

Reputation: 881

may I repeat, but it really helped me. In setting up my UIViewCollection i set: prefetchingEnabled = NO And this bug was not repeated and scrollItemAtIndexPath with animation works correct.

Upvotes: 1

Related Questions