I'm trying to detect a shake in iOS6, seems every single example ever was written back in 2009 or so for iOS3, and nothing's working as it should. Here's my method:
- (void) motionEnded: (UIEventSubtype) motion withEvent: (UIEvent *) event {
if (motion == UIEventSubtypeMotionShake) NSLog(@"Detected a shake");
}
I've tried what Apple suggest (making a canBecomeFirstResponder
method that returns YES
, and calling it), but it doesn't do anything. It's called fine, but has no impact on the shake not being recognized.
I've read some stuff about needing to create a custom version of my view, but I'd really rather not screw around with that because I didn't create the view programmatically and there are four or so of them.
Thanks in advance!