2
这是我的代码。我不能在我的设备上晃动/移动
-(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");
}
}
我想动摇我device.I /运动使用的代码,但它不工作..
帕特尔thanx,但在模拟器运动完成工作,但不是在设备.. –
看到我编辑的答案kamlesh ..... !!! – NiravPatel
Thanx它的工作... –