-
I updated to the latest version 2.18.2 and now I get the error 'AttributeContainer' is only available in iOS 15 or newer when I try to configure appearance.titleTextAttributes. Previously my code was like this: and everything worked, but now I get the error Cannot assign value of type '[Any Hashtable : NSObject]' to type 'AttributeContainer'. If I use the example code: then I get the error 'AttributeContainer' is only available in iOS 15 or newer. The current version of the project is ios13 and I don't want to upgrade it, how do I configure titleTextAttributes? I'm using UIKit. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, if #available(iOS 15.0, *) {
tabBarController?.popupBar.standardAppearance.titleTextAttributes = AttributeContainer()
.font(UIFontMetrics(forTextStyle: .headline).scaledFont(for: UIFont(name: "Chalkduster", size: 14)!))
.foregroundColor(UIColor.yellow)
} else {
tabBarController?.popupBar.standardAppearance.__titleTextAttributes = [
.font: UIFontMetrics(forTextStyle: .headline).scaledFont(for: UIFont(name: "Chalkduster", size: 14)!),
.foregroundColor: UIColor.yellow
]
} |
Beta Was this translation helpful? Give feedback.
Hello,
You can still use the old dictionary-based attributes for old operating systems like this: