With attributed accessibility labels, your app could now, for example, greet your users in different languages. Note that it will change to the voice of the corresponding language you are switching to.

let greetingLessonView = UIView()
let bcp47LanguageCode = "es-Es"
let translatedPhrase = "¡Buenos días! "
let attributedLabel = NSMutableAttributedString(string: translatedPhrase,attributes: [.accessibilitySpeechLanguage: bcp47LanguageCode])
attributedLabel.append(NSAttributedString(string: "Means: good morning!"))
greetingLessonView.accessibilityAttributedLabel = attributedLabel

