Search code examples
ioseventsgesturesuiscrollviewdelegate

How to unblock pan and pinch events in a UIScrollViewDelegate?


I have a UIView which has a UIScrollView subview and is a UIScrollViewDelegate. Since I've implemented viewForZoomingInScrollView I stopped getting pan and pinch events for the UIView.

How can I get these events back?


Solution

  • Try adding a delegate to your gesture recognizer that implements

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
        return YES;
    }