how to indicate shake is in right or left?
i want to implement next previous functionality using below function.
- (void)motionEnded:(UIEventSubtype)mt withEvent:(UIEvent *)event
But i dont know how to indicate in left or roght. Ple开发者_开发问答ase give me advice.
There is no way using this method to determine whether the shake was to the left or the right, it just detects a general shaking motion. You will need to process the accelerometer output in detail to achieve what you want. Look into the UIAccelerometer class and this similar question.
精彩评论