开发者

How to make an application perform an action whenever a shake is detected?

I want to know the way to display images whenever the iPhone detects a sh开发者_如何学Cake.The images would be those stored in a folder in the iPhone. A source code would really be helpful.


- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
      if (event.subtype == UIEventSubtypeMotionShake) {
                // The user shook the device
      }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜