I’m trying to add accessibilityActions to specific views in an app I’m working on for a client.
I’m using the accessibilityAction(named:)
viewModifier. I can’t share the client code, but it’s something like this:
HStack {
// Contents here
}
.accessibilityAction(named: "Double-tap to toggle the thing") {
theThing.toggle()
let onOffString = theThing ? "On" : "Off"
UIAccessibility.post(notification: UIAccessibility.Notification.announcement, argument: "Toggled the thing (onOffString)")
}
Based on what I’ve read from Apple, I would expect VO (VoiceOver) to announce “Actions available” as an a11y (accessibility) hint for the HStack
above.
It does not. VO acts as normal, and does not mention that there is an available a11y action. If the VO user swipes down with that HStack
selected, it does announce the name of the a11y action, and it triggers if the user double-taps with the action selected.
Am I missing something? Is there some code I need to add in order to get VO to announce that the view has a11y actions?
If it isn’t clear what I’m asking I could work to develop a minimal reproducible example, but it will take some effort on my part. Please ask if you feel that’s needed.