开发者

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

开发者 https://www.devze.com 2023-02-22 08:00 出处:网络
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)mot

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

精彩评论

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

关注公众号