專案上遇到手勢衝突問題,
如果是用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要如何寫
與寫在哪裡才能解決手勢衝突的問題呢?
還煩請版上前輩多多指教 謝謝