iOS 9, Xcode 7, Multitouch with SpriteKit
Asked Answered
G

3

5

Hello I've made an iOS game named 'Racing Horses' and published it to App Store. It was fine with playing on iOS 8.x.x, but after I installed iOS 9 Beta 3, in the same game (same codes), iPhone cannot recognize multiple touches. I have to leave my finger to make the next touch. But it was not like this, I could make a new tap even if I still hold my previous tap. What is the problem, what should I do?

Grearson answered 19/7, 2015 at 13:55 Comment(1)
Can you post the relevant code?Falsify
E
8

I had the same problem on a game launched this summer.
I had to explicitly enable multiple touch in the SKScene:

-(void)didMoveToView:(SKView *)view {
    self.view.multipleTouchEnabled = YES;
}

Here's more detail - The game uses sub-classes of SKSpriteNode. They test for number of touches depending on the the sprite. In the sub-class:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
     NSLog(@"TapCount  = %lu", (unsigned long)touches.count);

     if (touches.count == 2) {
          // do something
     }
}
Entelechy answered 29/9, 2015 at 20:39 Comment(0)
I
6

It looks like as of ios 9 multitouch has to be explicitly enabled. I don't think this used to be the case. I now have this issue on all my spritekit apps. Just adding self.view.multipleTouchEnabled = YES; in viewDidLoad, fixes it for me.

Iconostasis answered 28/7, 2015 at 20:30 Comment(0)
G
1

Just a simple mistake, I've enabled multitouch at interface builder, problem solved. But I don't know how it turned off by itself :)

Grearson answered 19/7, 2015 at 14:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.