I want to change my unselected tabbar button color. And i did some research about that on Stackoverflow. I applied the suggestions to my code but for some reason i didn't work for me. For example, I want to make my unselected tabbar button to pink color. How could i do that? I am sharing the screenshots of Main.storyboard tabbar selections
Also I am sharing my AppDelegate file:
if #available(iOS 13.0, *) {
let tabbar = UITabBarController()
tabbar.tabBar.unselectedItemTintColor = .systemPink
}
return true
}
Write this in your appDelegate - didFinishWithLaunching
Below line of code sets the tint color for the selected tab bar item. In this case, it's being set to blue. The "selected" tab bar item refers to the tab that is currently active or highlighted.
Below line of code sets the tint color for the unselected tab bar items, which are the tabs that are not currently active or highlighted. In this case, the unselected items will be tinted in system pink color.
You have assigned a class to UITabbar from storyboard - If you are going to use above code please remove that tabbar class from storyboard and if you want to keep that class, there should be a property to modify unselected tint. There is no point to manipulate native UITabbar's tint while you are using custom class for it.
Remember, it's important to make sure that any custom class you've assigned to the tab bar in the storyboard is not conflicting with the changes you're making programmatically. If you're still facing issues, consider providing more so I can assist you further.