gpt4 book ai didi

ios - 如何检测平移手势何时真正快速而不是精细地移动以相应地调整控制?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:14:35 25 4
gpt4 key购买 nike

在我的应用程序中,我可以让用户向上平移以调整控件,但是当他们非常快速地平移时它有点慢,我想跳得更多。

// 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"];
}
}

我将如何着手改变它以实现更快的加速?

最佳答案

关于ios - 如何检测平移手势何时真正快速而不是精细地移动以相应地调整控制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15991991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com