How to detect Shake Gesture while application in B

2019-08-06 02:41发布

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条回答
smile是对你的礼貌
2楼-- · 2019-08-06 03:30

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

查看更多
登录 后发表回答