ios Touch事件
2015-11-19 20:16
330 查看
记录直供自己备忘使用,勿喷。
/** * 说明touchesBegan 太灵敏了,换成touchesEnded * 判断当前的手指点击的地方是否在一个点击区域内,进行事件处理 */ -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ DLog(@"touchesBegan-------------"); UITouch *touch = [touches anyObject]; CGPoint currentLocation = [touch locationInView:self]; NSInteger tapCount = touch.tapCount; if (tapCount >= 2) { DLog(@"touchesBegan-------------typcount:%i", tapCount); } for (int i = 0; i < [_rectArr count]; ++i) { NSValue *value = [_rectArr objectAtIndex:i]; CGRect cgRect = [value CGRectValue]; if (CGRectContainsPoint(cgRect, currentLocation)) { //[SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"点击了%d行",i]]; if (self.delegate && [self.delegate respondsToSelector:@selector(landscapeBarNoXYView: didSelectLineBar:)]) { [self.delegate landscapeBarNoXYView:self didSelectLineBar:[NSString stringWithFormat:@"%i", i]]; } } } }
相关文章推荐
- iOS---限制文本框只能输入数字
- ios开发大连讯飞语音sdk
- ios开发用户反馈 客服sdk
- ios图标绘制
- ios编程富文本
- iOS - CocoaPods使用傻瓜简版
- iOS KVO 设计模式的应用
- ios编程之蓝牙交互
- ios编程360相机滤镜
- ios枷锁解锁
- iOS 删除navigationController栈中得某一个viewController
- iOS 数据持久化方案(牢记)
- IOS 把格式化的JSON字符串转换成字典
- ios 那些不能错过的Xcode插件
- iOS半透明效果(转)
- IOS 百度地图点聚合使用
- ios解析html
- iOS自定义tabBar手势侧滑返回(仿系统)
- iOS打包成.a静态库
- 在xcode6.1和ios10.10.1环境下实现真机测试