Search code examples
iosobjective-csprite-kitios9iphone-6

iOS 9 Spritekit Double Tap Not Working on iPhone 6S


I have been building a SpriteKit game for a while now. Its a card game that allows double-tap on card sprites for specific behaviors. Now that we're in iOS 9, double taps do not work at all on iPhone 6s. Works fine on iOS8, all devices.

In my SKScene, i'm using the touchesBegan method to detect taps:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    UITouch *touch = [touches anyObject];
    CGPoint touchLocation = [touch locationInNode:self];

    if(touch.tapCount==2) {
        NSLog(@"double-tap, but not for iPhone 6s");
    }
}

Is there anything new with iOS9 or the 6s specifically (3d touch?) that needs to be implemented now for SpriteKit games?

I would like to note that this works fine in the iPhone 6s simulator, but it does not on the actual device.

Also, touch.tapCount will report 3, 4, 5, 6, 7 etc. taps, but completely skips just the second tap.


Solution

  • According to https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.1/

    UIKit
    Note
    On 3D Touch capable devices, touch pressure changes cause 
    touchesMoved:withEvent: to be called for all apps running on iOS 9.0. 
    When running iOS 9.1, the method is called only for apps 
    linked with the iOS 9.0 (or later) SDK.
    
    Apps should be prepared to receive touch move events 
    with no change in the x/y coordinates.
    

    So if this problem can be caused by touchMoved.