iOS7 shakeBegan


I’m having issues getting the shakeBegan method to work.

My HypnosisView can and has becomeFirstResponder, but:

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    NSLog(@"Device was shaken!");
    if(motion == UIEventSubtypeMotionShake) {
        [self setCircleColor:[UIColor redColor]];

Does not print out that the Device was shaken. I’ve tested this on my device and simulator.

I read somewhere that some people had luck using motionEnded, but that’s not worked either. I’ve had motions working in an app I was working on (before I started reading your book) and never had issues.




I had becomeFirstResponder rather than canBecomeFirstResponder.