UIRotationGestureRecognizer as volume knob
I made a remote app for iPhone and now want to add some gestures to it. One of the gestures I would like is a rotation gesture to change volume.
My problem is: How can I "translate" rotation and velocity that are delivered by the UIRotationGestureRecognizer to percent volume?
I need to pass an absolute value to the system I remote control (like 1% or 50% or 100%) and I know the value set when the gesture starts. But how would I decide when rotation was far enough to increase开发者_运维技巧 or decrease the volume by 1%?
This makes a big knot in my head, so any help would be greatly appreciated. Thanks!
Usually the most a user can rotate his hand is 180˚, so i think it would make sense that 1% would be 180˚ / 100 = 1.8˚
精彩评论