Skip to content

'AttributeContainer' is only available in iOS 15 or newer #556

Closed Answered by LeoNatan
fury21 asked this question in General
Discussion options

You must be logged in to vote

Hello,
You can still use the old dictionary-based attributes for old operating systems like this:

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
	]
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LeoNatan
Comment options

Answer selected by LeoNatan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants