1

我的 cocos2d 应用程序具有抖动功能,我使用 UIAccelerometer 开发抖动功能。在 iOS 8 UIAccelerometer 仪表不工作。任何人都可以帮助我,如何在 cocos2d 应用程序中检测摇动手势。

谢谢....

4

1 回答 1

0

将此添加到您的视图控制器:

override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) {
    if motion == .MotionShake {
        // do something cool
    }
}
于 2016-05-13T22:50:31.487 回答