0

I have enabled paging in UICollectionView and I am doing horizontal scroll.

I would like to control the movement of UICollectionViewCell programatically that is whenever there is a swipe I want to cancel the manual dragging and I want to move the UICollectionView to offset that I am mentioning.

so basically no matter how speed the user swipes ... I will just move by some certain offset this way I will have tighter control over what part of UICollectionViewCell I am showing etc,

I tried to do this using UICollectionView delegates such as did begin dragging or did end dragging but still the manual dragging is hard to avoid... so the UICollectionView movement looks like double dragging that is first time ... manual movement is visible second time .. I am programatically moving ..

so how can I cancel the manual movement

second how can move to a particular offset ...I am able to move to particular index path.

any help is highly appreciated !

Gaurav Patel
  • 532
  • 1
  • 5
  • 19
Rajan M
  • 345
  • 3
  • 22
  • where's your code? – Imrul Kayes May 21 '18 at 07:29
  • the code is same as any sample collection view code for showing the cells in one row horizontally – Rajan M May 21 '18 at 07:31
  • you said **I tried to do this using collection view delegates such as did begin dragging or did end dragging but still the manual dragging is hard to avoid**. what was your approach? what was double dragging? Is it a thing, sample collectionview code contains? – Imrul Kayes May 21 '18 at 07:49
  • no actually what I did .. when end dragging fires , I programatically move the collection view to show the next cell ...so basically when the dragging ends.. its over then when I programatically move then it will move in UI again right . so it appears life double dragging and the view looks bit weird – Rajan M May 21 '18 at 09:50

0 Answers0