Normally registering for UIScreenBrightnessDidChangeNotification
provides notifications when the user finishes sliding the brightness slider in control center.
It appears there is a bug that prevents notifications from being sent when the brightness is set to 0.0
. Basically the range of values which produce notifications are (0.0, 1.0]
Am I missing something here?
Testing is as simple as:
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserverForName:UIScreenBrightnessDidChangeNotification
object:nil
queue:nil
usingBlock:^(NSNotification *notification)
{
NSLog(@"Brightness changed: %f", [[UIScreen mainScreen] brightness]);
}];