如果用户触摸某个区域,如何禁用平移手势?我有一个带有某些控件的区域,如果玩家的手指在该区域中,则我不希望该视图平移。我的手势代码为:
@objc func panedView(recognizer:UIPanGestureRecognizer){
mapButton?.isHidden = false
self.camera?.constraints = [ ]
let translation = recognizer.translation(in: self.view)
var pos = cameraNode.position
pos.x -= translation.x
pos.y += translation.y
self.cameraNode.run(SKAction.move(to: pos, duration: 0.1))
}