私のアプリでは、ユーザーが上にパンしてコントロールを調整するオプションがありますが、パンが非常に速くなると少し遅くなり、もっとジャンプしたいと思います。
// If user is panning upwards or downwards, adjust WPM every 8 translations in either direction
if (translation.y<-8 || translation.y>8) {
// Reset translation so we can see when it exceeds 8 again
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
// Figure out direction, if pan down, decrease by 5, if up, increase by 5
int sign = (translation.y > 0) ? -1 : 1;
WPM = @([WPM intValue] + (sign * 5));
if ([WPM intValue] >= 200 && [WPM intValue] <= 1500) {
self.WPMLabel.text = [WPM stringValue];
self.wordsPerMinute = WPM;
[[NSUserDefaults standardUserDefaults] setObject:WPM forKey:@"WPM"];
}
}
より速い加速を考慮してこれを変更するにはどうすればよいですか?