iOS has this notification that is triggered if the user or the system changes the brightness.
let noteCenter = NotificationCenter.default
noteCenter.addObserver(self,
selector: #selector(brightnessDidChange),
name: UIScreen.brightnessDidChangeNotification,
object: nil)
@objc func brightnessDidChange() { print(UIScreen.main.brightness) }
is there something like that for macOS?
Someone told me that this would be possible using CoreFoundation Callbacks, using "CFNotificationCenterAddObserver" but as expected, zero documentation on that can be found.
any ideas?