I want to control the brightness of the main-screen within my Mac OS X app (like the F1/F2 buttons). In iOS, there's something like this:
UIScreen.mainScreen().brightness = CGFloat(0.5)
In OSX we have NSScreen, which is nice to find out what the main-screen is, but it misses the .brightness
method.
So how can I adjust the monitor brightness using Swift on OSX?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…