IOS 9, Xcode 7, Multitouch with SpriteKit

Hi, I made an iOS game called "Racing Horses" and published it on the App Store. It was fine with the game on iOS 8.xx, but after I installed iOS 9 Beta 3, in the same game (same codes), the iPhone cannot recognize multiple touches. I have to leave my finger to make the next touch. But that was not the case, I could make a new click even if I was still holding my previous tap. What is the problem, what should I do?

+3


source to share


3 answers


I had the same problem in a game launched this summer.
I had to explicitly include multi-touch in SKScene

:

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

      



More details here - The game uses subclasses SKSpriteNode

. They check the number of touches depending on the sprite. In a subclass:

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

     if (touches.count == 2) {
          // do something
     }
}

      

+8


source


It looks like as of ios 9, multitouch should be explicitly enabled. I don't think it was like that. I now have this problem in all my spritekit applications. Just add self.view.multipleTouchEnabled = YES; in viewDidLoad, fixes this for me.



+6


source


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

+1


source







All Articles