手势和事件冲突的事件传递

···

  • (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    NSLog(@"touchesBegan");
    }

  • (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@"touchesMoved");
    }

  • (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
    NSLog(@"touchesCancelled");
    }

  • (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    NSLog(@"touchesEnded");
    }

  • (void)viewDidLoad {
    [super viewDidLoad];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap)];
    // tap.cancelsTouchesInView = NO;
    // tap.delaysTouchesBegan = YES;
    [self.view addGestureRecognizer:tap];

打印结果是啥
···

你可能感兴趣的:(手势和事件冲突的事件传递)