I\'m using this function to get current battery level of device:
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; UIDevice *myDevice = [UIDevice c
You can find a perfect answer here
Xcode: 11.4 Swift: 5.2
Click Here