iOS-自定义手势操作
2016-06-15 19:04
591 查看
1.自定义全局手势操作
2.局部手势
@property (nonatomic, strong) UIPanGestureRecognizer *panGestureRecognizer; -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; //原生方法无效 self.navigationController.interactivePopGestureRecognizer.enabled = NO; //设置手势 self.panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(openMenuClick)]; [self.view addGestureRecognizer:self.panGestureRecognizer]; } -(void)openMenuClick{ //进行相应操作 NSLog(@"进行相应操作"); }
2.局部手势
/** 左滑手势 */ @property (nonatomic, strong) UIScreenEdgePanGestureRecognizer *edgePanGestureRecognizer; -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; //原生方法无效 self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.edgePanGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(openMenuClick)]; self.edgePanGestureRecognizer.delegate = self; self.edgePanGestureRecognizer.edges = UIRectEdgeRight; [self.view addGestureRecognizer:self.edgePanGestureRecognizer]; } -(void)openMenuClick{ //进行相应操作 NSLog(@"进行相应操作"); }
相关文章推荐
- iOS下WebRTC音视频通话(二)-局域网内音视频通话
- iOS下WebRTC音视频通话(二)-局域网内音视频通话
- ios WaxPatch热更新原理
- ios wax热更新之安装wax(xcode7.3.1)
- iOS开发 - 滚动选择器
- iOS使用高德地图趟过的坑([MAMapKit] apiKey为空,请检查key是否正确设置)
- iOS开发emoji处理方式大起底
- ios 视频直播之蓝牙接入并转码成AAC
- iOS 隐藏下级页面的tabbar的统一处理
- iOS 开发常用官方文档
- iOS开发之百度地图的简单集成——标注&POI检索
- iOS10会带来哪些新变化?
- iOS开发多线程篇—自定义NSOperation
- iOS 线程间的通信 (GCD)
- iOS Layout机制相关方法
- ios搭建本地服务器
- iOS RunLoop
- RSA使用总结(ios,openssl)
- iOS实现xml的post传递,返回xml数据进行解析
- iOS 申请加急审核