Search code examples
swiftsprite-kitios9xcode7-beta3

iOS 9, Xcode 7, Multitouch with SpriteKit


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?


Solution

  • 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
         }
    }