Search code examples
iphonexcodebattery

Xcode - Is there a way to disable the Iphone from charging?


I know its a long shot, but is there a way (programitically) to stop the phone from charging when it is connected to charger?

Thanks.


Solution

  • No. You can monitor the battery’s status using a couple of methods on UIDevice, but it’s astronomically unlikely there will ever be an API to prevent charging.