let titleTextAttributes = [
NSAttributedString.Key.foregroundColor: normalColor,
NSAttributedString.Key.font: Font(10, .medium)]
let selectedTitleTextAttributes = [
NSAttributedString.Key.foregroundColor: selectedColor,
NSAttributedString.Key.font: Font(10,.medium)]
if #available(iOS 13.0, *) {
let itemAppearance = UITabBarItemAppearance()
itemAppearance.normal.titleTextAttributes = titleTextAttributes
itemAppearance.selected.titleTextAttributes = selectedTitleTextAttributes
let tabbarApperance = UITabBarAppearance()
tabbarApperance.stackedLayoutAppearance = itemAppearance
tabbarApperance.backgroundImage = UIImage(color: barBackgroundColor)
tabbarApperance.shadowImage = UIImage(color: barLineColor)
tabBar.standardAppearance = tabbarApperance
if #available(iOS 15.0, *) {
tabBar.scrollEdgeAppearance = tabbarApperance
}
} else {
UITabBarItem.appearance().setTitleTextAttributes(titleTextAttributes, for: .normal)
UITabBarItem.appearance().setTitleTextAttributes(selectedTitleTextAttributes, for: .selected)
tabBar.backgroundImage = UIImage(color: barBackgroundColor)
tabBar.shadowImage = UIImage(color: barLineColor)
}