Код: Выделить всё
{
let tabBar = self.tabBar
if #available(iOS 13.0, *) {
let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance.selected.iconColor = .systemGreen
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [.foregroundColor: UIColor.systemGreen]
appearance.stackedLayoutAppearance.normal.iconColor = .systemRed
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [.foregroundColor: UIColor.systemRed]
tabBar.standardAppearance = appearance
tabBar.scrollEdgeAppearance = appearance
} else {
tabBar.tintColor = .systemGreen
tabBar.unselectedItemTintColor = .systemRed
}
tabBar.items?.forEach { item in
item.image = item.image?.withRenderingMode(.alwaysTemplate)
item.selectedImage = item.selectedImage?.withRenderingMode(.alwaysTemplate)
}
}

Я ожидаю, что цвет значка будет таким же, как и текст в случае невыбранного элемента вкладки.

Подробнее здесь: https://stackoverflow.com/questions/797 ... e-in-ios26
Мобильная версия