• Tools
  • Articles
  • Q&A
  • Login
0 0

iPhone如何实现微信的摇一摇功能?


如何实现微信一样的摇一摇功能,如何通过代码实现检测iPhone摇晃?

http://developer.apple.com/library/io...

http://homepages.ius.edu/rwisman/C490...

http://www.edumobile.org/iphone/iphon...

http://www.ifans.com/forums/threads/t...
http://tech.pro/tutorial/968/iphone-t...

请输入图片描述

objective-c cocoa-touch

11 years, 11 months ago
此方♂彼方

此方♂彼方


share
此方♂彼方 11 years, 11 months ago

Answers

0

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

answered 11 years, 11 months ago
此方♂彼方

Editor


share
Editor answered 11 years, 11 months ago

Your Answer

Ask Question
Related questions

core foundation与objective-c区别?

NSException与NSError区别?

tableview cellForRowAtIndexPath不被执行

IOS NSInvocation 的主要用处?

typedef void (^BWStatusBarBasicBlock)(void);类型说...

在iOS项目中使用Lua脚本有什么好的应用场景?