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

The value cannot be updated immediately #34

Open
tooodooo opened this issue Jun 9, 2017 · 1 comment
Open

The value cannot be updated immediately #34

tooodooo opened this issue Jun 9, 2017 · 1 comment

Comments

@tooodooo
Copy link

tooodooo commented Jun 9, 2017

swift code:
self.navigationItem.rightBarButtonItem?.badgeValue = "\(count)"

First time it can be updaed immediately. When the value changed the view only be updated after a few seconds.

It updated after about 7 seconds in rootviewconroller. But it even doen't work in pushed viewcontroller when the value changed.

@tooodooo
Copy link
Author

tooodooo commented Jun 9, 2017

My mistake, message reception is asynchronous communication.

DispatchQueue.main.async { [weak self]() -> Void in self?.navigationItem.leftBarButtonItem?.badgeValue = "\(count)" }

it's okay.

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