更多参考 :
https://blog.csdn.net/EIamor/article/details/78293439
** tapges 与 uibutton 冲突, 如果是button 就不执行 tapges
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { if((touch.view)?.isKind(of: UIButton.self))!{ return false } return true; }
** 两个滑动 手势 冲突,
class ViewController: UIGestureRecognizerDelegate{ //下面两个事件在 .began 前触发 , 在触发时就设置X起始坐标 func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { let point = gestureRecognizer.location(in: self.view); if(point.x < xxx || point.x > (selfWh-xxx)){ selfDrag_start_x = point.x; return true; } return false } func a(){ let ges = UIPanGestureRecognizer(target: self, action: #selector(webBoxDrag)) ges.delegate = self xx(uiScrollView).addGestureRecognizer(ges) } }
扩展
if(gestureRecognizer.isKind(of: UIPanGestureRecognizer.self) == false){
return false;
}
如果不是 UIPanGestureRecognizer 就直接返回false
相关推荐
WHC_Model iOS平台高效转换引擎json->model,model->json,model->Dictionary,支持模型类继承其他模型类,支持指定路径转换,不区分json的key和模型属性名称大小写,自动处理json中null。
Yahoo开源的在线obj-c -> swift工具
NULL 博文链接:https://mft.iteye.com/blog/2310507
NULL 博文链接:https://mft.iteye.com/blog/2304029
NULL 博文链接:https://mft.iteye.com/blog/2343765
NULL 博文链接:https://mft.iteye.com/blog/2428573
NULL 博文链接:https://mft.iteye.com/blog/2296790
NULL 博文链接:https://mft.iteye.com/blog/2310323
NULL 博文链接:https://mft.iteye.com/blog/2313269
NULL 博文链接:https://mft.iteye.com/blog/2296699
NULL 博文链接:https://mft.iteye.com/blog/2297851
NULL 博文链接:https://mft.iteye.com/blog/2343587
Swift-单例Swift-单例Swift-单例Swift-单例Swift-单例
swift-request:声明式HTTP网络,专为SwiftUI设计
专为手势动画设计。 快速,简单,可扩展!
Swift-Radio-Pro:完整的Swift 2.0的App 开源应用
Swift版的手势密码
模仿淘宝、腾讯新闻、网易等手势返回效果的控制器转场交互动画
( the-swift-programming-language-swift-4.epub ) ( the-swift-programming-language-swift-4.epub )