4

I have a UICollectionView that animates its bounds when a user lifts their finger from the screen. The collection view either grows or shrinks based on how much the user scrolled. This works great if the user lifts their finger up whilst the UICollectionView is stationary however if they flick the scroll view unexpected results happen.

enter image description here

As you can see the UICollectionViewCell disappears before it has a chance the naturally scroll away.

I am using AutoLayout and therefore animating the constraints of the collection view calling [self.view layoutIfNeeded]; I want to suggest that the animation is getting in the way of the scrolling judging by the way the scrollbar moves, it seems to set the UICollectionView to its projected end contentOffset then animate the slide up.

I would like to know why this effect is happening? And any tips on how to fix it!

William George
  • 6,506
  • 3
  • 27
  • 39

0 Answers0