1

I am making a SpriteKit game I was wondering if there was a way to prevent more than one touch at a time.

in my game an object gets added at every touch and I kinda don't want that. (even though its hilarious) if there is a way how do I do it? what would I use? and could you point me in the right direction? and I know that there are ways to do it as I have seen multiple games with that feature.

would I put something into 'appdelegate.swift' to prevent that or would it have something to do with the 'touches began' function I have tried several methods but none seem to work also I have searched all over google but to no avail.

if somebody could help me with this I would appreciate it but its not really that important as it doesn't upset the balance of the game at all.

E. Huckabee
  • 1,788
  • 1
  • 13
  • 29

1 Answers1

2

You can use multipleTouchEnabled property of a UIView:

When set to YES, the view receives all touches associated with a multi-touch sequence and starting within the view's bounds. When set to NO, the view receives only the first touch event in a multi-touch sequence that start within the view's bounds. The default value of this property is NO.

Use it like this self.view.multipleTouchEnabled = false, where self is a scene.

Whirlwind
  • 14,286
  • 11
  • 68
  • 157