Skip to content
New issue

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

到最后1秒,还是要到主线程中更新UI #1

Open
appke opened this issue Mar 30, 2016 · 0 comments
Open

到最后1秒,还是要到主线程中更新UI #1

appke opened this issue Mar 30, 2016 · 0 comments

Comments

@appke
Copy link

appke commented Mar 30, 2016

不在主线程中更新界面,会有一点延迟

if (timeOut <= 0) {
    dispatch_source_cancel(timer);

    dispatch_async(dispatch_get_main_queue(), ^{
        weakSelf.backgroundColor = mColor;
        [weakSelf setTitle:title forState:UIControlStateNormal];
        weakSelf.userInteractionEnabled = YES;
    });
}
@appke appke changed the title 到最后1秒,还是要到主线程中刷新 到最后1秒,还是要到主线程中更新UI Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant