iOS中如何使定时器NSTimer不受UIScrollView滑动所影响
以下是使用 scheduledTimerWithTimeInterval 方法来实现定时器
- (void)addTimer
{
NSTimer scheduledTimerWithTimeInterval:2.0 repeats:YES block:^{
[self nextImage];
}
}
该方法会自动为我们实例化的timer添加到当前线程的RunLoop中,并且默认模式是 NSDefaultRunLoopMode 。但当前线程是主线程时, 当scrollView或其...
原创
2020-12-24 10:29:55 ·
206 阅读 ·
0 评论