Skip to content

Instantly share code, notes, and snippets.

@PoomSmart
Created June 26, 2015 13:26
Show Gist options
  • 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