iOS-倒计时

iOS使用dispatch进行倒计时,使用NSTimer总是感觉有问题,不是在滑动的时候倒计时卡住不动了,就是scheduledTimerWithTimeInterval对iOS版本有要求,所以直接使用dispatch_source_set_timer的方式倒计时,刷新界面,测试是不会卡顿的。记录下,反正哪个方便用哪个,用的少,记下,方便下次要用的时候不知道怎么写了…
dispatch_queue_t queue;
dispatch_source_t timer;

// 开启倒计时效果
- (void)openCountdown:(NSTimeInterval)timeCount {
__weak typeof(self) selfWeak = self;
__block NSInteger time = timeCount; //倒计时时间
queue = dispatch_ge

iOS-倒计时最先出现在Python成神之路

版权声明:
作者:玉兰
链接:https://www.techfm.club/p/26798.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>