UILongPressGestureRecognizer and UIPanGestureRecognizer Combined
Domanda
I'm implementing both UILongPressGestureRecognizer
and UIPanGestureRecognizer
The UIPanGestureRecognizer
should start on a drag and the UILongPressGestureRecognizer
should start on a long press
Unfortunately when UIPanGestureRecognizer
is called with a drag also the UILongPressGestureRecognizer
is being called.
Thanks!
Soluzione
This UIGestureRecognizerDelegate method does exactly what I looked for:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
See: Combining a UILongPressGestureRecognizer with a UIPanGestureRecognizer
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow