Save and define a specific style of iphone shaking gestures

In my project, I implemented a shake gesture on the iphone. I want to save a specific shake pattern (for example, shake like the word "S") from the user, and I need to trigger the event only on a specific pattern. Is this possible in iphone? If possible, can someone guide me with some link please?

+6
source share
4 answers

Go through the Basic Motion Programming Guide and Link to the Core Core Structure . and understand that the iPhone is driving the apis movement, you will be able to realize your own motion event.

+3
source

When you purchase pradeepa, you need to learn how to use Core Motion and the UIAccelerometer API - start with the "Motion Events" chapter in the event handling programming guide .

For your custom figure motion recognizer, you will need to evaluate the movement of the device in space (x / y / z-) over time.

+2
source

This project may help, AcceleroMusic . You need to define x, y, z to display your specific shake pattern ("S").

+2
source

Yes, I think Listen for a terrific effect on the iphone, or you can use

CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; theAnimation.duration=1; theAnimation.repeatCount=2; theAnimation.autoreverses=YES; theAnimation.fromValue=[NSNumber numberWithFloat:0]; theAnimation.toValue=[NSNumber numberWithFloat:-60]; [view.layer addAnimation:theAnimation forKey:@"animateLayer"]; 

Hope this helps you

+2
source

All Articles