I’m making a recreation app the place the participant solutions a query (by clicking a button) after which the subsequent query instantly seems.
That is working effective in its regular state, however I can not get it to perform persistently with Voice Over. More often than not, when the consumer clicks a button to reply the current query, the Voice Over says “button” as an alternative of the subsequent query.
I might be pleased with considered one of:
-
The Voice Over says “button” after which asks the query instantly afterwards.
-
The Voice Over says “button” solely when the consumer single clicks, to allow them to safely reply by double clicking.
-
The Voice Over by no means says “button” in any respect (notice: the buttons are fairly massive and make sound results anyway, so it could nonetheless be clear what’s being pressed).
Any recommendation with this?
I’m utilizing Storyboard (however would nonetheless be pleased about a SwiftUI answer, if it exists).
The query asking seems like this:
func newQuestion(lastCorrect: Bool? = nil) { Â Â Â Â
//Supplies the subsequent query.
let new: String = "..."
       Â
if UIAccessibility.isVoiceOverRunning && lastCorrect != nil {
if lastCorrect == true { Â Â Â Â Â Â Â Â
UIAccessibility.submit(notification: .announcement, argument: "Sure. (new)")
} else {
UIAccessibility.submit(notification: .announcement, argument: "No. (new)")
} Â Â Â Â
} Â Â
}
And the buttons are easy UIButtons:
@IBAction func optionPressed(_ sender: UIButton) { Â Â Â Â
//When pressed, play the sound impact and test the reply.
playSound()
if that is right {
newQuestion(lastCorrect: true)
}Â else {
newQuestion(lastCorrect: false)
}
}
