解决手势与按钮冲突问题

实现这个手势代理的函数;

tapGesture.delegate = self;

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

{

    CGPoint location = [touch locationInView:self.view];

    if(CGRectContainsPoint(button.frame, pointLocation))

    {

        return NO;

    }

    return YES;

}

你可能感兴趣的:(button,冲突,手势)