Search code examples
iosobjective-caccessibilitywatchkit

Find out if VoiceOver is enabled and set VoiceOver Focus on Apple Watch


I'm currently trying to make my game become more accessible by adding VoiceOver support. Everything is working fine on iOS, but I have some struggle with the watchOS Version. I need a way to find out, if VoiceOver is currently enabled to remove certain images based questions in the game. So ist there anything like:

UIAccessibilityIsVoiceOverRunning()  

in WatchKit?

And also, is it possible to move the accessibility focus to a certain element? Something comparable to:

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, view);    

Thanks, Klemens


Solution

  • To check if it's running

    let isVoiceOverOn: Bool = WKAccessibilityIsVoiceOverRunning()
    if isVoiceOverOn {
        // do some VoiceOver stuff
    } else {
        // do some stuff that does not make sense for VoiceOver
    }
    

    To find out when VoiceOver starts and stops observe:

    WKAccessibilityVoiceOverStatusChanged