如何检测iPhone Cocos2D中的抖动手势?在iOS 8中

如何检测iPhone Cocos2D中的抖动手势?在iOS 8中,ios,cocos2d-iphone,uiaccelerometer,Ios,Cocos2d Iphone,Uiaccelerometer,我的cocos2d应用程序有震动功能,我使用UIG开发震动功能。在iOS 8中,加速度计不工作。有谁能帮我,如何在cocos2d应用程序中检测抖动手势 谢谢……将此添加到视图控制器: override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { if motion == .MotionShake { // do something cool } } -(无效)加速计:

我的cocos2d应用程序有震动功能,我使用UIG开发震动功能。在iOS 8中,加速度计不工作。有谁能帮我,如何在cocos2d应用程序中检测抖动手势


谢谢……

将此添加到视图控制器:

override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) {
    if motion == .MotionShake {
        // do something cool
    }
}

-(无效)加速计:(UIAccelerator*)加速计DID加速度:(UIAcceleration*)加速度
此功能是否不工作。。即使你使用<代码>[[UID加速度计]设置委托:自我]。。或
self.isAccelerometerEnabled=YESinit
中的code>或
CCLayer
中的
onEnter
?如果下面的答案不是您想要的,请告诉我。将乐于更改或删除