4
votes

Currently, I'm making paging UICollectionView. I want to disable gesture swipe effect from UICollectionView as I'm going to add UIPagerControl to animate the paging UICollectionView. I don't want user uses their finger to move to next screen instead of using custom UIPageControl.

1

1 Answers

7
votes

A UICollection inherits from UIScrollView and the user's scrolling can be disable this way:

myCollectionView.scrollEnabled = NO;

Here is the documentation explanation (UIScrollView class reference):

When scrolling is disabled, the scroll view does not accept touch events; it forwards them up the responder chain.

When using your UIPageControl, you can programmatically set the position in your UICollectionView using the UIScrollView method:

- (void)setContentOffset:(CGPoint)contentOffset
                animated:(BOOL)animated