0

I am working on a game where I need touchesMoved and touchesEnded but after the stage is completed, I want to DISABLE touchesMoved and touchesEnded and enable only SWIPE GESTURES.

So how can I achieve this?

When the game is being played: I want swipe gestures to be disabled and touchesBegan, touchesMoved, touchesEnded should be enabled.

When the game is completed: I want touchesBegan, touchesMoved, touchesEnded to be disabled And swipe gestures to be enabled.

Please help me out. Thanks.

チーズパン
  • 2,752
  • 8
  • 42
  • 63

1 Answers1

0

When you want to disable touch return false in below method.

 func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
    return false
}
kb920
  • 3,039
  • 2
  • 33
  • 44