macOS Hight Sierra / Mojave: Programmatically get value of “System Preferences -> Accessibility ->...
up vote
0
down vote
favorite
How programmatically get value of Increase contrast setting on macOS Hight Sierra? Also interesting to know how to observe that value change.
Full path to system preference is System Preferences -> Accessibility -> Display -> Increase contrast.

On macOS Mojave it can be achieved via effectiveAppearance.bestMatch API call like below.
open override func layout() {
super.layout()
if #available(OSX 10.14, *) {
if let value = effectiveAppearance.bestMatch(from: [.aqua, .darkAqua, .accessibilityHighContrastAqua, .accessibilityHighContrastDarkAqua]) {
switch value {
case .aqua:
setupAppearance(.light)
case .darkAqua:
setupAppearance(.dark)
case .accessibilityHighContrastAqua:
setupAppearance(.highContrastLight)
case .accessibilityHighContrastDarkAqua:
setupAppearance(.highContrastDark)
default:
break
}
}
}
}
macos-high-sierra macos-mojave
add a comment |
up vote
0
down vote
favorite
How programmatically get value of Increase contrast setting on macOS Hight Sierra? Also interesting to know how to observe that value change.
Full path to system preference is System Preferences -> Accessibility -> Display -> Increase contrast.

On macOS Mojave it can be achieved via effectiveAppearance.bestMatch API call like below.
open override func layout() {
super.layout()
if #available(OSX 10.14, *) {
if let value = effectiveAppearance.bestMatch(from: [.aqua, .darkAqua, .accessibilityHighContrastAqua, .accessibilityHighContrastDarkAqua]) {
switch value {
case .aqua:
setupAppearance(.light)
case .darkAqua:
setupAppearance(.dark)
case .accessibilityHighContrastAqua:
setupAppearance(.highContrastLight)
case .accessibilityHighContrastDarkAqua:
setupAppearance(.highContrastDark)
default:
break
}
}
}
}
macos-high-sierra macos-mojave
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How programmatically get value of Increase contrast setting on macOS Hight Sierra? Also interesting to know how to observe that value change.
Full path to system preference is System Preferences -> Accessibility -> Display -> Increase contrast.

On macOS Mojave it can be achieved via effectiveAppearance.bestMatch API call like below.
open override func layout() {
super.layout()
if #available(OSX 10.14, *) {
if let value = effectiveAppearance.bestMatch(from: [.aqua, .darkAqua, .accessibilityHighContrastAqua, .accessibilityHighContrastDarkAqua]) {
switch value {
case .aqua:
setupAppearance(.light)
case .darkAqua:
setupAppearance(.dark)
case .accessibilityHighContrastAqua:
setupAppearance(.highContrastLight)
case .accessibilityHighContrastDarkAqua:
setupAppearance(.highContrastDark)
default:
break
}
}
}
}
macos-high-sierra macos-mojave
How programmatically get value of Increase contrast setting on macOS Hight Sierra? Also interesting to know how to observe that value change.
Full path to system preference is System Preferences -> Accessibility -> Display -> Increase contrast.

On macOS Mojave it can be achieved via effectiveAppearance.bestMatch API call like below.
open override func layout() {
super.layout()
if #available(OSX 10.14, *) {
if let value = effectiveAppearance.bestMatch(from: [.aqua, .darkAqua, .accessibilityHighContrastAqua, .accessibilityHighContrastDarkAqua]) {
switch value {
case .aqua:
setupAppearance(.light)
case .darkAqua:
setupAppearance(.dark)
case .accessibilityHighContrastAqua:
setupAppearance(.highContrastLight)
case .accessibilityHighContrastDarkAqua:
setupAppearance(.highContrastDark)
default:
break
}
}
}
}
macos-high-sierra macos-mojave
macos-high-sierra macos-mojave
asked Aug 9 at 19:35
Vlad
1,50011631
1,50011631
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Starting on macOS 10.10 you can use this API of NSWorkspace.
https://developer.apple.com/documentation/appkit/nsworkspace/1526290-accessibilitydisplayshouldincrea
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Starting on macOS 10.10 you can use this API of NSWorkspace.
https://developer.apple.com/documentation/appkit/nsworkspace/1526290-accessibilitydisplayshouldincrea
add a comment |
up vote
1
down vote
accepted
Starting on macOS 10.10 you can use this API of NSWorkspace.
https://developer.apple.com/documentation/appkit/nsworkspace/1526290-accessibilitydisplayshouldincrea
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Starting on macOS 10.10 you can use this API of NSWorkspace.
https://developer.apple.com/documentation/appkit/nsworkspace/1526290-accessibilitydisplayshouldincrea
Starting on macOS 10.10 you can use this API of NSWorkspace.
https://developer.apple.com/documentation/appkit/nsworkspace/1526290-accessibilitydisplayshouldincrea
answered Nov 10 at 12:20
DR.
361
361
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51774587%2fmacos-hight-sierra-mojave-programmatically-get-value-of-system-preferences%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password