I Can't Shake/Motion on my device
That's my code.
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(shake)
name:@"shake" object:nil];
if(event.type == UIEventTypeMotion && event.subtype ==
UIEventSubtypeMotionShake)
{
// SOMETHING HERE
}
NSLog(@"motion Began");
}
else
{
NSLog(@"Shake Is Over");
}
}
I want to shake/motion on my device.I used that code but it is not
working.. enter code here
No comments:
Post a Comment