开发者

Detect shaking method detect in xcode4

How to detect the shaking method detect in xcode4 and开发者_C百科 that method displays NSLog,

spacially i used xcode4 and detect the method of the shaking in simulator of xcode,

hoe to shake iphone simulator.

pls help,

Your regards

Thanks in Advance.


To detect the shake in your code you should use something like:

-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
    if(motion == UIEventSubtypeMotionShake)
    {               
        NSLog(@"DID SHAKE DEVICE");
    }
}

To simulate the shake gesture in the Simulator go to Hardware -> Shake Gesture

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜