0
votes

I have the UIScrollView with pagingEnabled set to YES, and programmatically scroll its content offset to a particular point where the user taps using the following code:

[self.scrollView setContentOffset: CGPointMake(x, y) animated: NO];

It scrolls successfully to this point (x,y), but now if I do a single tap ,its content scrolls up to top. When paging is disabled , it does not scroll to top but I need paging to be enabled. Does any one know how can it be fixed?

1

1 Answers

0
votes

Try to use this function:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
  shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer

check the class of the otherGestureRecognizer if it's a tap return NO, else return YES.