UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

how to keep button tap enabled after adding accessibility

Forums > SwiftUI

I have a small quiz game, it asks a questions and gives two options, after i add accessibilty to read out custom text at end of ZStack which contains the questions and its options, every time now when i want to click on options , it simply re reads the whole text...

what i want is for the user to be able to listen to each option again by tapping it once and then choosing which option to select by double tapping...

how can i allow the user this option in accessibility , thanks

my accessibility code at end of ZStack

I have tried adding .accessibilityLabel to each View, experimented with .accessibilityElement(children: .ignore) but no luck so far

real issue is the loss of ability to treat each View independently once custom accessibilty is added

 .accessibilityElement(children: .ignore)
                    .accessibilityLabel("Question  \(quizQuestion[questionNumber].question), option 1 is \(quizQuestion[questionNumber].options[0]), option 2 is \(quizQuestion[questionNumber].options[1])")

1      

Have you tried making your accessibility labels more granular, by putting them on each of the statements (Text, ForEach, Button, etc.) rather than the whole Zstack?

1      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.