I want my redDot
to display when I have some value in badge, i.e UIApplication.shared.applicationIconBadgeNumber
this is the code I wrote, but doesnt seem to work :
import UserNotifications
@IBOutlet weak var redDot: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
runCheck()
}
func runCheck(){
if (UIApplication.shared.applicationIconBadgeNumber>=1) {
self.redDot.alpha=1
}
else {
self.redDot.alpha=0
}
}