UIGestureRecognizerDelegate手势代理

2017-09-21  本文已影响65人  FallPine
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    // 返回NO表示,手势事件不会根据响应者链传递,当前的touch对象会被忽略,相当于手势识别失败,然后就会走默认的touch系列回调方法
    if ([touch.view isDescendantOfView:self.myContent]) {
        return NO;
    }
    return YES;
}
// 这个代理方法返回YES,表示同时识别多个手势
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}
上一篇 下一篇

猜你喜欢

热点阅读