Skip to content

Instantly share code, notes, and snippets.

@PoomSmart
Created June 26, 2015 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PoomSmart/f5dfbd1d7448ab19f3a2 to your computer and use it in GitHub Desktop.
Save PoomSmart/f5dfbd1d7448ab19f3a2 to your computer and use it in GitHub Desktop.
Proximity Sensor in Landscape mode.
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