I'm trying to handle a mouse scroll wheel in one of my views (to invoke my zoomIn/zoomOut methods) using a UIPanGestureRecognizer with:
UIPanGestureRecognizer* panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:myView action:@selector(handlePanGesture:)];
panRecognizer.allowedScrollTypesMask = UIScrollTypeMaskDiscrete;
[myView addGestureRecognizer:panRecognizer];
My handlePanGesture
method is successfully called twice (once for UIGestureRecognizerStateBegan and UIGestureRecognizerStateEnded), but... then what do I do?
The passed UIPanGestureRecognizer* has numberOfTouches = nil
, and I can't get any further info about the scroll wheel UIEvent from UIGestureRecognizer or its superclass.
How to I tell if it was a scroll up, or a scroll down?
See: wwdc20-10094