2014-09-24 6 views
1

내 cocos2d 앱이 흔들어주는 기능이 있습니다. UIAccelerometer를 사용하여 흔들기 기능을 개발합니다. iOS 8에서는 UIAccelerometer 미터가 작동하지 않습니다. 어느 누구도 나를 도울 수 있습니까? cocos2d 앱에서 흔들기 제스처를 감지하는 방법.iPhone Cocos2D에서 손떨림을 감지하는 방법은 무엇입니까? iOS 8에서

감사합니다 ....

+0

'- (무효) 가속도계 : (UIAccelerometer *) 가속도계 didAccelerate : acceleration' (UIAcceleration *)이 기능은 만약 당신이 ..'[[UIAccelerometer sharedAccelerometer] setDelegate : self];'..' 또는'self.isAccelerometerEnabled = YES;'를'init' 또는'onEnter'에서'CCLayer'를 사용한다고해도? –

+0

답장이 당신이 찾고있는 것이 아닌지 알려주십시오. 기꺼이 변경하거나 삭제할 수 있습니다. - –

답변

0

당신의보기 컨트롤러에이 추가 :

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