Reputation: 1
I'm wondering if it's possible to override var batteryState: UIDeviceBatteryState
.
For example, if the UIDeviceBatteryState
is set to charging
(i.e. charger is plugged in) would it be possible to disable the charging by changing it to unplugged
?
Thanks in advance!
(Apple docs on UIDeviceBatteryState
):
https://developer.apple.com/documentation/uikit/uidevicebatterystate
Upvotes: 0
Views: 54
Reputation: 74
var batteryState: UIDeviceBatteryState { get }
it is get only property so you can't set value
Upvotes: 0
Reputation: 5521
No, you can't override batteryState
. It is even marked as { get }
in the docs you linked. The closest thing you'd be able to do is to hide the status bar completely within your app.
Upvotes: 2