ios - swipe and pan gesture overlap -
is possible let specific gesture fail next possible gesture recognized?
to more specific, @ sample snippet:
uiswipegesturerecognizer *swipeleft = [initialize uiswipegesturerecognizer... @selector(handleswipe:)] swipeleft = uiswipegesturerecognizerdirectionleft; swipeleft.delegate = self; uipangesturerecognizer *pan = [initialize uipangesturerecognizer... @selector(handlepan:)] pan.delegate = self; [pan requiregesturerecognizertofail:swipeleft];
the above code states if swipe left not recognized device, pan gesture handler used.
so question: possible let swipeleft intentionally fail (after being recognized swipe left touch device) based on criteria checked on handleswipe, , let pan gesture handle touch input instead?
thanks.
check out uigesturerecognizerdelegate
protocol here:
specifically, the
gesturerecognizer:shouldrecognizesimultaneouslywithgesturerecognizer:
method might useful. if return yes
method, both gestures can recognized @ same time, can respond both.
Comments
Post a Comment