HWCountdownDemo
HWCountdownDemo copied to clipboard
到最后1秒,还是要到主线程中更新UI
不在主线程中更新界面,会有一点延迟
if (timeOut <= 0) {
dispatch_source_cancel(timer);
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.backgroundColor = mColor;
[weakSelf setTitle:title forState:UIControlStateNormal];
weakSelf.userInteractionEnabled = YES;
});
}