This is a class I made to detect shakes. It’s really simple, you just create an object, initialize it, set a delegate, and it will send messages to the delegate when the movement change is significant, then your object can do whatever you want, like refreshing info or whatever.
Details:
- Detects side shakes.
- Has a mechanism to avoid sending multiple messages for one long shake.
- Sensitivity can be edited easily.
- It has it’s protocol, so you don’t have to add new methods to your receiver’s interface.
- It uses #ifndef’s so it can be imported several times without causing errors for having the same class multiple times.
- Only one can be working at the time (activating a new one will deactivate the previous working one).





