Reputation: 5331
I would like switch on/off low power mode in an application. Is it possible to control battery mode from an iOS application.
Upvotes: 2
Views: 1482
Reputation: 82759
Apple has not exposed any public APIs to allow control of low power mode.
but we can Detecting Low Power mode using the following code , the detail information provided in Apple Documents
Objective C
if ([[NSProcessInfo processInfo] isLowPowerModeEnabled]) {
// Low Power Mode is enabled. Start reducing activity to conserve energy.
} else {
// Low Power Mode is not enabled.
}
Swift
if ProcessInfo.processInfo.isLowPowerModeEnabled {
// Low Power Mode is enabled. Start reducing activity to conserve energy.
} else {
// Low Power Mode is not enabled.
}
Upvotes: 3