Skip to content

Instantly share code, notes, and snippets.

@aplekhanov
Created January 22, 2016 13:25
Show Gist options
  • Save aplekhanov/7bb6d71bdc026bdcefa1 to your computer and use it in GitHub Desktop.
Save aplekhanov/7bb6d71bdc026bdcefa1 to your computer and use it in GitHub Desktop.
Get battery level on iOS device.
UIDevice *myDevice = [UIDevice currentDevice];
[myDevice setBatteryMonitoringEnabled:YES];
NSLog(@"%f", myDevice.batteryLevel);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment