I have an app which send remote local notifications, I want to check value of my badge and display redDot
accordingly. This is what I tired but doesn't seem to work,
override func viewDidLoad() {
super.viewDidLoad()
if UIApplication.shared.applicationIconBadgeNumber>=1{
self.redDot.alpha=1
}
else{
self.redDot.alpha=0
}
}
when I print the value of UIApplication.shared.applicationIconBadgeNumber
it prints 0
instead it of 1
because thats the value of my badge.