Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View Controller contents behind my UIAlertController are being read by VoiceOver

I have a UIAlertController that I am presenting with a view controller. Before presenting the UIAlertController I set accessibilityViewIsModal to true but when using VoiceOver it still focuses on, and reads out everything on the view controller "behind" the UIAlertController (the one that I presented my UIAlertController with)

let alertController = UIAlertController(title: alertTitle, message: nil, preferredStyle: .alert)
alertController.accessibilityViewIsModal = true
present(alertController, animated: true, completion: nil)

Any ideas on how I can prevent VoiceOver from reading the content not in the alert dialog?

like image 835
J2N Avatar asked Aug 07 '17 20:08

J2N


1 Answers

I fixed this after speaking with a colleague.

Setting accessibilityViewIsModal on the view of the UIAlertController fixes this as the view controller itself was not the view VoiceOver was focusing on.

alertController.view.accessibilityViewIsModal = true

This should be handled automatically though, and therefore I am filing a radar with Apple on it. Will update this answer with the bug ID soon.

Radar filed https://bugreport.apple.com/web/?problemID=33779950

like image 119
J2N Avatar answered Nov 15 '22 03:11

J2N