iPhone App increase Shake gesture Sensitivity

对着背影说爱祢 提交于 2020-01-23 05:13:46

问题


In my iPhone App I have used shake gesture it is working but it requires lots of efforts to shake

Is there any way to make it more sensitive or increase the sensitivity?

here is the code

 - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
 {
      if (motion == UIEventSubtypeMotionShake)
      {
          [self performSelector:@selector(startPressed:)];  
      }
 } 

Please help and Suggest.

Thanks


回答1:


The isnt a way to do it directly as far as I'm aware.

One way to get around this would be to use the accelerometer's readings, and then decide for yourself if it was a shake, you would be able to fine tune it yourself if so.



来源:https://stackoverflow.com/questions/9562168/iphone-app-increase-shake-gesture-sensitivity

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