UIBarButtonItem-Badge icon indicating copy to clipboard operation
UIBarButtonItem-Badge copied to clipboard

The value cannot be updated immediately

Open tooodooo opened this issue 7 years ago • 1 comments

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 avatar Jun 09 '17 13:06 tooodooo

My mistake, message reception is asynchronous communication.

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

it's okay.

tooodooo avatar Jun 09 '17 14:06 tooodooo