详解iOS cancelsTouchesInView delaysTouchesBegan delaysTouchesEnded
来源:互联网 发布:淘宝店铺怎么设置运费 编辑:程序博客网 时间:2024/05/18 05:59
- (void)viewDidLoad {
[superviewDidLoad];
UITapGestureRecognizer *tap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(tapAction)];
/*
2017-03-03 11:57:35.266 ResponseChain[53875:3956994] =========> base view touchs Began
2017-03-03 11:57:35.391 ResponseChain[53875:3956994] =========> single Tapped
2017-03-03 11:57:35.392 ResponseChain[53875:3956994] =========> base view touchs Cancelled
2017-03-03 11:57:40.240 ResponseChain[53875:3956994] =========> click testbtn
2017-03-03 11:57:41.784 ResponseChain[53875:3956994] =========> base view touchs Began
2017-03-03 11:57:41.920 ResponseChain[53875:3956994] =========> single Tapped
2017-03-03 11:57:41.920 ResponseChain[53875:3956994] =========> base view touchs Cancelled
*/
//tap.cancelsTouchesInView = NO;
/*
2017-03-03 11:54:04.806 ResponseChain[53805:3954398] =========> base view touchs Began
2017-03-03 11:54:04.909 ResponseChain[53805:3954398] =========> single Tapped
2017-03-03 11:54:04.910 ResponseChain[53805:3954398] =========> base view touchs Ended
2017-03-03 11:54:07.400 ResponseChain[53805:3954398] =========> single Tapped
2017-03-03 11:54:07.401 ResponseChain[53805:3954398] =========> click testbtn
2017-03-03 11:54:10.654 ResponseChain[53805:3954398] =========> base view touchs Began
2017-03-03 11:54:10.725 ResponseChain[53805:3954398] =========> single Tapped
2017-03-03 11:54:10.726 ResponseChain[53805:3954398] =========> base view touchs Ended
*/
tap.delaysTouchesBegan =YES;
/*tap.delaysTouchesBegan = YES || tap.cancelsTouchesInView = NO输出结果
2017-03-03 11:50:57.172 ResponseChain[53740:3952166] =========> single Tapped
2017-03-03 11:51:03.564 ResponseChain[53740:3952166] =========> single Tapped
2017-03-03 11:51:05.636 ResponseChain[53740:3952166] =========> single Tapped
//tap.delaysTouchesBegan = YES 输出结果
2017-03-03 11:51:56.599 ResponseChain[53775:3953294] =========> single Tapped
2017-03-03 11:51:58.296 ResponseChain[53775:3953294] =========> click testbtn
2017-03-03 11:51:59.655 ResponseChain[53775:3953294] =========> single Tapped
*/
tap.delaysTouchesEnded =YES;
/*
2017-03-03 11:47:59.749 ResponseChain[53704:3950843] =========> base view touchs Began
2017-03-03 11:47:59.891 ResponseChain[53704:3950843] =========> single Tapped
2017-03-03 11:47:59.892 ResponseChain[53704:3950843] =========> base view touchs Ended
2017-03-03 11:48:06.323 ResponseChain[53704:3950843] =========> single Tapped
2017-03-03 11:48:06.324 ResponseChain[53704:3950843] =========> click testbtn
2017-03-03 11:48:22.708 ResponseChain[53704:3950843] =========> base view touchs Began
2017-03-03 11:48:22.789 ResponseChain[53704:3950843] =========> single Tapped
2017-03-03 11:48:22.789 ResponseChain[53704:3950843] =========> base view touchs Ended
*/
[self.viewaddGestureRecognizer:tap];
[_testBtnaddTarget:selfaction:@selector(testBtnClicked)forControlEvents:UIControlEventTouchUpInside];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSLog(@"=========> base view touchs Began");
}
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSLog(@"=========> base view touchs Moved");
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSLog(@"=========> base view touchs Ended");
}
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSLog(@"=========> base view touchs Cancelled");
}
- (void)tapAction {
NSLog(@"=========> single Tapped");
}
- (void)testBtnClicked {
NSLog(@"=========> click testbtn");
}
详细内容:http://www.jianshu.com/p/cb0314b72883
demo 下载地址:https://github.com/sunjie19921111/ResponseChain
- 详解iOS cancelsTouchesInView delaysTouchesBegan delaysTouchesEnded
- 手势的3个混淆属性 cancelstouchesinview delaystouchesbegan delaystouchesended
- 手势的3个容易混淆的属性 cancelsTouchesInView/delaysTouchesBegan/delaysTouchesEnded
- cancelsTouchesInView
- cancelsTouchesInView初见
- tap.cancelsTouchesInView
- UIGestureRecognizer cancelsTouchesInView
- iOS 最简单解决事件冲突的思路,深入浅出cancelsTouchesInView属性
- 【iOS】iOS之viewcontroller详解
- iOS CALayer详解,动画详解。
- IOS CBAC详解
- 苹果ios详解
- ios NSFileManager 用法详解
- 详解iOS App生命周期
- ios property详解
- 详解iOS App生命周期
- ios UIView详解~~~~~
- IOS沙盒详解
- 获取属性的各个部分的内容(权限修饰符变量类型变量名)
- Afinal 下载功能errorNo=0 下载失败
- Composer的命令行工具
- The Backend Implementation of HugeGraph
- memcached源代码安装
- 详解iOS cancelsTouchesInView delaysTouchesBegan delaysTouchesEnded
- 如何获取Class的实例(3种)
- 16bit数据高低8位交换的4种实现方法
- python学习
- tensorflow `conv2d max_pool 方法参数
- DataGridView实现列头ChechBox人性化方案。
- c#110课的主要内容
- 在Android开发中,定时执行任务的3种实现方法
- 图的建立之邻接表的建立及遍历