tags:

views:

19

answers:

0

Hi everyone, I'm trying to enable shake gestures within my application but I'm having a problem.

I have different view controllers, but on one of them (not the main view controller for the application) nothing happens in response to a shake gesture. What could be the problem?

The relevant code is as follows:

-(BOOL)canBecomeFirstResponder {
    return YES;
}

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self becomeFirstResponder];
}


-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event

{
    if (event.subtype == UIEventSubtypeMotionShake)
    {


 NSLog (@"SHAKED");

    }
}