I would like to have an adaptative text in my UITabBarItem that minimize the font size if it get too large.
For example:
Here is my code:
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "Read-Regular", size: 10)!], for: .normal)
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "Read-Regular", size: 10)!], for: .selected)
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.black], for: .normal)
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .selected)
Is there any option equivalent to the label:
valueLabel.adjustsFontSizeToFitWidth = true
valueLabel.minimumFontSize = 0.5
Thanks in advance.