zoukankan      html  css  js  c++  java
  • 接近感应传感器

    [[UIDevice currentDevice] setProximityMonitoringEnabled:YES];
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(sensorStateChange:)
                                                     name:@"UIDeviceProximityStateDidChangeNotification"
                                                   object:nil];

    -(void)sensorStateChange:(NSNotificationCenter *)notification;
    {
        if ([[UIDevice currentDevice] proximityState] == YES) {
            NSLog(@"Device is close to user");
        }else{
            NSLog(@"Device is not close to user");
        }
    }

  • 相关阅读:
    ES6
    django创建超级用户
    小程序-网络请求api
    小程序-数据双向绑定
    POJ2406 Power Strings
    POJ2758 Checking the Text
    LightOJ1197
    51Nod
    CF55D
    Kattis
  • 原文地址:https://www.cnblogs.com/ligun123/p/2311897.html
Copyright © 2011-2022 走看看