Created
June 26, 2015 13:26
-
-
Save PoomSmart/f5dfbd1d7448ab19f3a2 to your computer and use it in GitHub Desktop.
Proximity Sensor in Landscape mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void setLandscapeProximityEnabled(BOOL enabled) | |
{ | |
UIDevice *dev = [UIDevice currentDevice]; | |
if (enabled) { | |
[dev _setExpectsFaceContactInLandscape:YES]; | |
dev.proximityMonitoringEnabled = YES; | |
} else { | |
dev.proximityMonitoringEnabled = NO; | |
[dev _setExpectsFaceContactInLandscape:NO]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment