美文网首页
手势和事件冲突的事件传递

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

作者: zaijianbali | 来源:发表于2022-06-01 11:29 被阅读0次

···

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

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

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

  • (void)touchesEnded:(NSSet<UITouch *> *)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];

打印结果是啥
···

相关文章

网友评论

      本文标题:手势和事件冲突的事件传递

      本文链接:https://www.haomeiwen.com/subject/ycvzprtx.html