Name Last Update
VoiceoverDetectionSpike Loading commit data...
VoiceoverDetectionSpike.xcodeproj Loading commit data...
VoiceoverDetectionSpikeTests Loading commit data... Loading commit data...

VoiceOver Status Detection

No longer working :(

Apple seems to have broken this (testing with Xcode 8.2.1 and Swift 3 under macOS Sierra 10.12.2) as accessibilitySetValue(_:forAttribute:) is no longer getting called. This is a shame as they have not implemented an NSAccessibilityIsVoiceOverRunning() method of their own (even though there is a UIAccessibilityIsVoiceOverRunning() on iPhone/iPad and WKAccessibilityIsVoiceOverRunning() on Apple Watch).

Enables VoiceOver status to be queried and observed on OS X.


import Cocoa

class ViewController: NSViewController
    @IBOutlet weak var voiceOverStatusLabel: NSTextField!
    @IBOutlet weak var voiceOverIconImageView: NSImageView!

    var voiceOverObserver:NotificationObserver!

    override func viewDidAppear()

        voiceOverObserver = handle(NSAccessibilityVoiceOverStatusChanged) { notification in

            let voiceOverIsRunning = NSAccessibilityIsVoiceOverRunning()
            var statusMessage = "VoiceOver is "
            statusMessage += voiceOverIsRunning ? "on." : "off."

            self.voiceOverStatusLabel.stringValue = statusMessage
            self.voiceOverIconImageView.enabled = voiceOverIsRunning


    override func viewWillDisappear()

(See NSNotificationCenterExtensions for the custom notification observing code. Yes, that’s an emoji in there… deal with it.) :)


Open VoiceoverDetectionSpike.xcodeproj in Xcode and drag VoiceOverStatus.swift into your own project.


  • For updates, listen to the NSAccessibilityVoiceOverStatusChanged notification. The userInfo dictionary will have the current status in the IsVoiceOverRunning key.

  • You can also call the NSAccessibilityIsVoiceOverRunning() function to get the current status of VoiceOver.

(These mirror the UIAccessibilityVoiceOverStatusChanged notification and UIAccessibilityIsVoiceOverRunning() function on iOS.)


Run the project for a demonstration.

ViewController.swift is where the magic happens.


Copyright © 2015 Aral Balkan. Released with by under the MIT License.