[問題] 手勢gesture衝突之問題

作者: yavis (yavis)   2015-06-12 17:16:46
專案上遇到手勢衝突問題,
如果是用code宣告swipe與pan手勢,
UISwipeGestureReognizer *swipe = [..]以及
UIPanGestureRecRecognizer *pan = [..];
可用[pan requireGestureRecognizerToFail:swipe]解決,
但今天我用了storyboard拖曳swipe與pan進View,
並寫了兩個function如下,
-(IBAction)swipe:(UISwipeGestureRecognizer *)sender{
// do something;
}
-(IBAction)pan:(UIPanGestureRecognizer *)snder{
// do something;
}
我的requireGestureRecognizerToFail要如何寫
與寫在哪裡才能解決手勢衝突的問題呢?
還煩請版上前輩多多指教 謝謝
作者: darktt (小朱)   2015-06-12 17:38:00
請去看Delegate的-gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer與-gestureRecognizer:shouldRequireFailureOfGestureRecognizer

Links booklink

Contact Us: admin [ a t ] ucptt.com