Created
March 26, 2015 21:32
-
-
Save lyonanderson/a92b7592fe94ef7cc62c to your computer and use it in GitHub Desktop.
Show detailed battery info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PreferenceBundles/BatteryUsageUI.bundle"]; | |
[bundle load]; | |
Class BatteryUsageQueryModuleClaszz = NSClassFromString(@"BatteryUsageQueryModule"); | |
Class BatteryUIControllerClazz = NSClassFromString(@"BatteryUIController"); | |
if (BatteryUIControllerClazz) { | |
self.batteryUIController = (BatteryUIController*)[[BatteryUIControllerClazz alloc] init]; | |
[self.batteryUIController setBatteryUIType:2]; | |
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.batteryUIController]; | |
[self presentViewController:navController animated:YES completion:^{ | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment