0

I want to determine shake gesture along with the direction in which device is shacked like left right up or down. I am using

-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration method

but i am not getting the direction of shake from this method. Can anyone suggest any algorithm or something through which it is possible to detect.

Thanks

Dhara
  • 4,093
  • 2
  • 36
  • 69
  • I believe you need the Core Motion framework for this. – Bamsworld Jan 10 '14 at 07:38
  • http://stackoverflow.com/questions/6223296/how-to-detect-direction-of-shake-in-iphone http://stackoverflow.com/questions/7253058/horizontal-and-verticle-shake-count-using-accelerometer-in-iphone-ipad http://stackoverflow.com/questions/1018770/how-to-determine-the-direction-of-a-iphone-shake – Vincent Sit Jan 10 '14 at 09:05
  • @Vincent am able to detect right and left movement but not up and down and also its difficult to detect when both up and right motion takes place. – Dhara Jan 10 '14 at 11:12
  • For left and right, I posted my solution here : http://stackoverflow.com/a/29030985/1668837 – Jon - LBAB Mar 13 '15 at 11:26