How to control the UICollectionViewCell movement programatically

98 Views Asked by At

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 !

0

There are 0 best solutions below