accessibilitySpeechIPANotation is sometimes handy in English where a word is spelled the same but pronounced differently depending of the context. Some examples are: live, read... Or you may want to correct how VoiceOver pronounces your app's name!

Example shows how you can specify the correct pronunciation for the text “Most read” and for the word “Live” in the context of direct broadcasting, using the IPA notation. The code sets an accessibilityAttributeLabel to the UILabel (or UIView) with the string and a dictionary containing the accessibilitySpeechIPANotation attribute key and the “Most rēd” or “laɪv” values.

Example code in the image:

let liveNewsChannelView = UIView()
let attributedLabel = NSMutableAttributedString(string: "24 hour news channel. ")

attributedLabel.append(NSAttributedString(string: "Live",attributes: [.accessibilitySpeechIPANotation: "laɪv"]))

liveNewsChannelView.accessibilityAttributedLabel = attributedLabel

You may also find interesting...

If you are developing a custom component, that can change value, chances are that it will need the adjustable accessibility trait (VoiceOver will say: "Adjustable"). Think of a component that lets you rate from one to five thumbs up (or stars).

An interesting speech attribute for attributed accessibility labels is accessibilitySpeechIPANotation that lets you specify how VoiceOver should pronounce a label with the International Phonetic Alphabet (IPA) notation. https://developer.apple.com/documentation/foundation/nsattributedstring/key/accessibilityspeechipanotation

Potential benefits from grouping logical pieces of information and moving buttons to custom actions: reduce redundancy (by removing repetitive controls) and reduce cognitive load (by making easier to know what item will be affected by each action)

Created in Swift with Ignite.

Supporting Swift for Swifts