Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 cocos2d 应用程序具有抖动功能,我使用 UIAccelerometer 开发抖动功能。在 iOS 8 UIAccelerometer 仪表不工作。任何人都可以帮助我,如何在 cocos2d 应用程序中检测摇动手势。
谢谢....
将此添加到您的视图控制器:
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { if motion == .MotionShake { // do something cool } }