[ad_1]
In Daniel Devesa Derksen-Staats’ e book ‘Growing Accessible iOS Apps’, the next instance is included to indicate how IPA (Worldwide Phonetic Alphabet) notation can be utilized to specify the VoiceOver pronunciation:
let ipaAttributedText = NSMutableAttributedString(string: "Paella is a Valencian rice dish")
let ipaRange = ipaAttributedText.string.vary(of: "Paella")!
ipaAttributedText.addAttributes([.accessibilitySpeechIPANotation: "paˈeʎa"], vary: NSRange(ipaRange, in: ipaAttributedText.string))
ipaLabel.attributedText = ipaAttributedText
// Excerpt From: Daniel Devesa Derksen-Staats. “Growing Accessible iOS Apps.” Apple Books.
The consequence, no less than in iOS 15, is clearly not what was meant. The accessibility label, because it seems within the VoiceOver caption is "ipa, Paellais a Valencian rice dish" – and that is how it’s learn. The VoiceOver synth’s pronunciation is roughly ‘paylace’, that’s, it’s fully ignoring the phonetic transcription (I can exchange "paˈeʎa" with actually something, the pronunciation does not change). Additionally any whitespace between the goal phrase and what follows is deleted within the caption and pronunciation. Within the console, I can output the worth of the ipaAttributedText, every little thing there seems to be okay:
Paella{
UIAccessibilitySpeechAttributeIPANotation = "paU02c8eU028ea";
} is a Valencian rice dish{
}
This weblog put up incorporates a really comparable instance, differing solely in that it units the .accessibilityAttributedLabel as an alternative of .attributedText, nevertheless it fails in the identical manner.
Is that this damaged on iOS 15? or is there one thing else wanted to make this work?
[ad_2]
