Search code examples
iosaudiovoiceoveruiaccessibility

VoiceOver reads Label even when button is double-tapped


I have set up the customized Hint for my UIButton. What I expect is that when single-tapped, the button will read the Hint; when double-tapped the Hint will not sound, but the normal button action will happen.

But in fact, the Hint is read again on double-tap, while at the same time the normal button action happens. The re-reading would be annoying enough, but the normal action is to play a different sound. They wind up being combined. Yecch!

One would think the UIAccessibilityTraitPlaysSound would be the thing to use, but it has no effect. I could just use AllowsDirectInteraction, but would then lose the Hint. In any case, the re-reading of the Hint on double-tap is just wrong. IMHO.


Solution

  • If I recall correctly, the plays sound trait refers to the activation sound (that sounds like a brief "blip"), and is used for an element that wants to play its own activation sound.

    If you are playing anything more/longer than an activation sound, I think that you should be using the starts media session trait instead.

    UIAccessibilityTraitStartsMediaSession 
    

    The accessibility element starts a media session when it is activated.

    You can use this trait to silence the audio output of an assistive technology, such as VoiceOver, during a media session that should not be interrupted. For example, you might use this trait to silence VoiceOver speech while the user is recording audio.