We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最终答案中只需要
//创建 Timer,然后添加到 NSRunLoopCommonModes NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(timerTick:) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
就能解决 Timer 计时会被 scrollView 的滑动影响。
增加下面的代码会导致无滑动事件时,计时器回调两次,因为 NSRunLoopCommonModes 包括了 UITrackingRunLoopMode 和 NSDefaultRunLoopMode
//将timer添加到NSDefaultRunLoopMode中 [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerTick:) userInfo:nil repeats:YES];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
最终答案中只需要
就能解决 Timer 计时会被 scrollView 的滑动影响。
增加下面的代码会导致无滑动事件时,计时器回调两次,因为 NSRunLoopCommonModes 包括了 UITrackingRunLoopMode 和 NSDefaultRunLoopMode
The text was updated successfully, but these errors were encountered: