获取当前电量是多少

    [UIDevice currentDevice].batteryMonitoringEnabled = YES;

    double deviceLevel = [UIDevice currentDevice].batteryLevel;

    NSLog(@"电量使用情况%f",deviceLevel);


你可能感兴趣的:(iOS开发)