aumanets
aumanets

Reputation: 3823

UICollectionView weird scroll issue

I making the universal app, and weird scroll issue happens on iPhone.

When I slide my finger to scroll through the collection view, normally when you tap on UICollectionView it stops (For example Photos App), in my case it continues to scroll. It only stops to scroll if the scrolling speed is low.

Other issue, not sure if related: the scrollToTop doesn't work on iPhone while on iPad it works fine.

This behavior occurs on physical devices and simulator, with iOS 6.1.

Upvotes: 0

Views: 606

Answers (1)

aumanets
aumanets

Reputation: 3823

I've found the solution to my issue. I have not described this implementation detail before, because I didn't knew that it was related to my issue.

I'm using the SDWebImage framework to download and cache remote images, and when the image is downloaded, I animate the cell using the UIView animateWithDuration block.

I was using the following the following code to perform the animation:

[UIView animateWithDuration:ANIMATION_TIME animations:^{
   // Animation Code
}];

It looks like by default, UIView animateWithDuration doesn't allow interaction during the animation. The following code solved my issue:

[UIView animateWithDuration:ANIMATION_TIME
                      delay:0
                    options:(UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction)
                 animations:^{
                     // Animation Code
               } completion:nil];

Upvotes: 1

Related Questions