I have a navigation controller with 4 tab bar items. Each one has a navigation controller inside. I want to be able to change the 4th tab bar badge number when I get push notifi
No need to select that index to update badge value. Take an array of tab bar items. The select item at the index which you want to update and then set it badge value. See below I have done for 4th tab bar item.
Swift 5.0
if let items = self.tabBarController?.tabBar.items as NSArray? {
let tabItem = items.object(at: 3) as! UITabBarItem
tabItem.badgeValue = "34"
}