How to detect VoiceOver status changes in Mac app

I have a Mac application.

I want to enable / disable some app functionality depending upon if VoiceOver has been enabled or not.


I know that I can detect if VoiceOver has been enabled / disabled using [[NSWorkspace sharedWorkspace] isVoiceOverEnabled].


Apart from this, I want to register for a notification to detect the changes in VoiceOver status (enabled / disabled).

I found that, this can be achieved in iOS by registering to UIAccessibilityVoiceOverStatusDidChangeNotification notification.

But, I did not find similar notification for macOS.


Can anyone please let me know how can I achieve this in macOS.

Replies

The doc comment associated with the

voiceOverEnabled
property in
<AppKit/NSAccessibility.h>
makes it clear that you can watch for changes using KVO:
/* Indicates if VoiceOver is currently running. This is observable through KVO. */

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"