With UIPanGestureRecognizer, is there a way to only act so often, like after x many pixels were panned?
问题 Right now my UIPanGestureRecognizer recognizes every single pan, which is great and necessary, but as I'm using it as a sliding gesture to increase and decrease a variable's value, within the method I only want to act every so often. If I increment by even 1 every time it's detected the value goes up far too fast. Is there a way to do something like, every 10 pixels of panning do this, or something similar? 回答1: You're looking for translationInView:, which tells you how far the pan has