- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// 1.开启距离传感器
[UIDevice currentDevice].proximityMonitoringEnabled = YES;
// 2.发送通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(proximityState) name:UIDeviceProximityStateDidChangeNotification object:nil];
}
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // 1.开启距离传感器 [UIDevice currentDevice].proximityMonitoringEnable