Reputation: 2376
macOS gives users a choice to "increase contrast".
I am trying to support this within a macOS app. Specifically, I want to adjust the fill of NSBox
What's the way to do it?
Update
There is a NSWorkspace.accessibilityDisplayOptionsDidChangeNotification
notification however, it doesn't appear to fire.
Upvotes: 1
Views: 408
Reputation: 2796
NSWorkspace.accessibilityDisplayOptionsDidChangeNotification
fires when option changes. The only thing is, it fires in NSWorkspace
's notification center. Not in the default one.
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(accessibilityDisplayOptionsDidChange(_:)), name: NSWorkspace.accessibilityDisplayOptionsDidChangeNotification, object: NSWorkspace.shared)
Then you have to use NSWorkspace.shared.accessibilityDisplayShouldIncreaseContrast
property in your code to alter the appearance of your UI when necessary.
Upvotes: 1