var rotateRecognizer = UIRotationGestureRecognizer(target: self,action: "handleRotate:")var pinchRecognizer = UIPinchGestureRecognizer(target: self,action: "handlePinch:")testV.addGestureRecognizer(rotateRecognizer)testV.addGestureRecognizer(pinchRecognizer)解决方法 在swift 3中,委托方法名称是:
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer,shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { return true }
您还需要为手势设置委托:
rotateRecognizer.delegate = selfpinchRecognizer.delegate = self总结
以上是内存溢出为你收集整理的迅速 – 同时解除捏合和旋转手势全部内容,希望文章能够帮你解决迅速 – 同时解除捏合和旋转手势所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)