I have a text CPN34THX
which should be read by voiceover as C N 3 4 T H X
Is there any property to be set to UIAccessibility
so that it can be read character by character?
You should use .accessibilitySpeechSpellOut
or .accessibilitySpeechIPANotation.
instead to make it spelling
let code = "CPN34THX"
let accessibleCode = NSMutableAttributedString(string: code, attributes:[.accessibilitySpeechSpellOut: true])
myLabel.accessibilityLabel = accessibleCode
Set the accessibilityLabel
separately as you needed.
let code = "CPN34THX"
let accessibleCode = code.map(String.init).joined(separator: " ") // output: "C P N 3 4 T H X"
myLabel.text = code
myLabel.accessibilityLabel = accessibleCode
For making it more pronounceable, make a string like this:
myLabel.accessibilityLabel = "C^. P^. N^. 3. 4. T^. H^. X^."