I have a UITabBar
. I set a value for tab bar items:
tabBarItem3?.badgeValue = String(self.numberOfProducts)
Now I want to change its font to a specific font. Then I used this code :
tabBarItem3?.setBadgeTextAttributes([NSFontAttributeName: UIFont(name: "IRANSans", size: 14)], for: .normal)
It doesn't work. What should I do?
Swift 3
UITabBarItem.appearance().setBadgeTextAttributes([.font: UIFont.systemFont(ofSize: 30, weight: .medium)], for: .normal)
UITabBarItem.appearance().setBadgeTextAttributes([.font: UIFont.systemFont(ofSize: 30, weight: .medium)], for: .selected)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With