How to detect Shake Gesture while application in Background?

﹥>﹥吖頭↗ 提交于 2019-12-11 07:29:35

问题


I'm currently working on a music player app, and like the iPod application, I would like to shuffle songs with shake gesture.

I'm implementing motion methods like Apple recommends to, and in foreground everything works fine.

- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event;
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event;
- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event;

But I just can't figure out how to call those methods from background. I've looked all over the internet, and there's not threads about this.

first things first: is it possible?

Thanx!


回答1:


It's not possible now, whether you use iOS 4 or any lower SDK version.



来源:https://stackoverflow.com/questions/5858792/how-to-detect-shake-gesture-while-application-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!