I want to reset the badge value of the tapItem if the user has seen the notification by visiting the screen.
With this code, I create the badgeValue. but it will never be reset:
func createBadgecount() {
if let tapItems = self.tabBarController?.tabBar.items as NSArray! {
let tapItem = tapItems[3] as! UITabBarItem
tapItem.badgeColor = UIColor.black
tapItem.badgeValue = "\(reports.count)"
}
}
Thanks in advance for your help!