do IBAction on shake gesture
I have set my iPhone app up so that it writes "Shake!" to the `NSLog` when the user shakes the iPhone:

    - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if (motion == UIEventSubtypeMotionShake) {
    NSLog(@"shake!");
    }
    }
and this is working. I have got an IBAction in my code as well. Can I set it to do the IBAction when it is shaken?
do IBAction on shake gesture
===

I have set my iPhone app up so that it writes "Shake!" to the `NSLog` when the user shakes the iPhone:

    - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if (motion == UIEventSubtypeMotionShake) {
    NSLog(@"shake!");
    }
    }
and this is working. I have got an IBAction in my code as well. Can I set it to do the IBAction when it is shaken?