Infinite Possibilities
Infinite Possibilities

Reputation: 7476

How to enable multiple touches in an iOS app?

Here is the code:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  if ([touches count] == 1) {
    // code
  } else {
    // code
  }
}

When I simulate the double tap with the Option key in simulator, the code always chooses the first part of my if statement, as if there were only 1 touch received.

Why am I not receiving both touches?

Upvotes: 2

Views: 1632

Answers (1)

kennytm
kennytm

Reputation: 523684

The multipleTouchEnabled property needs to be set to YES before the view can accept multitouch.

Upvotes: 4

Related Questions