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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With