Actually, with some tricks, you can set the tint of an individual button.
let button1 = UITabBarItem(title: "Btn1", image: UIImage(systemName: "heart"), tag: 1)
let button2 = UITabBarItem(title: "Btn2", image: UIImage(systemName: "heart"), tag: 2)
let button3 = UITabBarItem(title: "Btn3", image: UIImage(systemName: "heart"), tag: 3)
let button4 = UITabBarItem(title: "Btn4", image: UIImage(systemName: "heart"), tag: 4)
let button5 = UITabBarItem(title: "Btn5", image: UIImage(systemName: "heart"), tag: 5)
tabBar.items = [button1, button2, button3, button4, button5]
// setting tint of the button4
if let imageView = tabBar.subviews[4].subviews.first as? UIImageView {
imageView.tintColor = UIColor.red
imageView.image = UIImage(systemName: "heart.fill")
}
If you decide also to change the image of the button, use the same imageView and not button4.image, otherwise some other random button may change its tint. The tabBar.subviews[0] is the background image to the bar itself, the subsequent subviews are the buttons you added. Each element is of type UITabBarButton that has two subviews: first UITabBarSwappableImageView and the second UITabBarButtonLabel.