In loadView I'm adding myself as observer for
[nc addObserver:self
selector:@selector(proximityAlert:)
name:UIDeviceProximityStateDidChangeNotification
object:device];
then I tell device to start generating those alerts
[device setProximityMonitoringEn开发者_运维知识库abled:YES];
and I handle them in
-(void)proximityAlert:(NSNotification *)note
The problem is that when I cover the sensor for too long, the screen turns off, which in my app's case is not convenient.
Thanks in advance for all answers.
idleTimerDisabled
is not a valid solution to this question. (Not deleting as comments below will go lost if I do.)
精彩评论