• 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

12 years, 1 month ago
此方♂彼方

此方♂彼方


share
此方♂彼方 12 years, 1 month ago

Answers

0

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

answered 12 years, 1 month ago
此方♂彼方

Editor


share
Editor answered 12 years, 1 month ago

Your Answer

Ask Question
Related questions

core foundation与objective-c区别?

iOS系统通讯录应用的姓名拼音自动补全是如何实现的?

tableview cellForRowAtIndexPath不被执行

IOS NSInvocation 的主要用处?

如何在ios 相机页面上加入带有XIB的UIView同时还能满足MVC的设计模式?

视图view.window返回当前keywindow吗?