开发者

Detect shaking method detect in xcode4

开发者 https://www.devze.com 2023-03-16 03:39 出处:网络
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,

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

精彩评论

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