Is it possible to somehow observe property of UIApplication.sharedApplication()
in swift
?
I need to track UIApplication.sharedApplication().applicationIconBadgeNumber
to update my app UI
based on that number, but whenever this property is changed UI is not affected.
My code regarding this:
private var badgeCount: String = String(UIApplication.sharedApplication().applicationIconBadgeNumber)
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.notificationsButton.setTitle(self.badgeCount, forState: .Normal)
}